<?php
namespace App;
use Exception;
use Log;
use App\Judgetask;

class Solution
{
    public $hint = "";
    public $res = false;
    public $can = true;
    public $score = 0;

    public function solve($id, $answer, $uname, $uid, $info)
    {
        if ($id == 18) return $this->t18($answer);
        if ($id == 20) return $this->t20($answer);
        if ($id == 23) return $this->t23($answer);
        if ($id == 25) return $this->t25($answer);
        if ($id == 27) return $this->t27($answer, $uname);
        if ($id == 28) return $this->t28($answer);
        if ($id == 31) return $this->t31($answer);
        if ($id == 34) return $this->t34($answer, $uname);
        if ($id == 35) return $this->t35($answer);
        if ($id == 36) return $this->t36($answer);
        if ($id == 37) return $this->t37($answer);
        if ($id == 41) return $this->t41($answer);
        if ($id == 43) return $this->t43($answer);
        if ($id == 45) return $this->t45($answer);
        if ($id == 46) return $this->t46($answer);
        if ($id == 47) return $this->t47($answer);
        if ($id == 48) return $this->t48($answer);
        if ($id == 49) return $this->t49($answer);
        if ($id == 50) return $this->t50($answer);
        if ($id == 51) return $this->t51($answer);
        if ($id == 52) return $this->t52($answer);
        if ($id == 53) return $this->t53($answer);
        if ($id == 54) return $this->t54($answer);
        if ($id == 55) return $this->t55($answer);
        if ($id == 56) return $this->t56($answer);
        if ($id == 57) return $this->t57($answer);
        if ($id == 58) return $this->t58($answer);
        if ($id == 59) return $this->t59($answer);
        if ($id == 60) return $this->t60($answer);
        if ($id == 61) return $this->t61($answer);
        if ($id == 62) return $this->t62($answer);
        if ($id == 63) return $this->t63($answer);
        if ($id == 64) return $this->t64($answer);
        if ($id == 65) return $this->t65($answer);
        if ($id == 66) return $this->t66($answer);
        if ($id == 67) return $this->t67($answer);
        if ($id == 68) return $this->t68($answer);
        if ($id == 70) return $this->t70($answer);
        if ($id == 71) return $this->t71($answer);
        if ($id == 72) return $this->t72($answer);
        if ($id == 73) return $this->t73($answer);
        if ($id == 74) return $this->t74($answer);
        if ($id == 76) return $this->t76($answer);
        if ($id == 77) return $this->t77($answer);
        if ($id == 78) return $this->t78($answer);
        if ($id == 81) return $this->t81($answer);
        if ($id == 82) return $this->t82($answer);
        if ($id == 83) return $this->t83($answer);
        if ($id == 86) return $this->t86($answer);
        if ($id == 87) return $this->t87($answer);
        if ($id == 88) return $this->t88($answer);
        if ($id == 89) return $this->t89($answer);
        if ($id == 90) return $this->t90($answer);
        if ($id == 93) return $this->t93($answer);
        if ($id == 94) return $this->t94($answer);
        if ($id == 96) return $this->t96($answer);
        if ($id == 97) return $this->t97($answer);
        if ($id == 98) return $this->t98($answer);
        if ($id == 100) return $this->t100($answer);
        if ($id == 101) return $this->t101($answer);
        if ($id == 103) return $this->t103($answer);
        if ($id == 105) return $this->t105($answer);
        if ($id == 106) return $this->t106($answer);
        if ($id == 107) return $this->t107($answer);
        if ($id == 108) return $this->t108($answer);
        if ($id == 109) return $this->t109($answer);
        if ($id == 110) return $this->t110($answer);
        if ($id == 112) return $this->t112($answer);
        if ($id == 116) return $this->t116($answer);
        if ($id == 118) return $this->t118($answer);
        if ($id == 124) return $this->t124($answer);
        if ($id == 127) return $this->t127($answer,$uname);
        if ($id == 132) return $this->t132($answer);
        if ($id == 133) return $this->t133($answer);
        if ($id == 134) return $this->t134($answer);
        if ($id == 138) return $this->t138($answer,$uname);
        if ($id == 139) return $this->t139($answer,$uname);
        if ($id == 140) return $this->t140($answer,$uname);
        if ($id == 141) return $this->t141($answer);
        if ($id == 142) return $this->t142($answer,$uname);
        if ($id == 143) return $this->t143($answer,$uid,$info);
        if ($id == 144) return $this->t144($answer);
        if ($id == 145) return $this->t145($answer);
        if ($id == 146) return $this->t146($answer,$uid);
        if ($id == 147) return $this->t147($answer);
        if ($id == 148) return $this->t148($answer,$uid);
        $this->can = false;
    }
	private function t146($answer, $uid)
	{

        $data = array();
        $data['created_at'] = date("Y-m-d H:i:s");
        $data['updated_at'] = date("Y-m-d H:i:s");
        $data['userid'] =$uid;
        $data['taskid'] = 146;
        $data['lan'] = "python";
        $data['code'] = $answer;
        $data['judge_info'] = "";
        $data['status'] = 0;
		Judgetask::create($data);

		
        $this->hint='<a href="http://www.qlcoder.com/judge/status?page=1">url</a>';

	}	

	private function t141($answer)
	{
		if(strpos($answer,"dreamhost")!=false)$this->res=true;
		if(strpos($answer,"hacker")!=false)$this->res=true;
		if(strpos($answer,"mpeg")!=false)$this->res=true;
	}

	private function t142($answer,$uname)
	{
		$path="/opt/jail/home/qlcoder/onlinejudge/task_142_zigzag/user_codes/".md5($uname."7fa224e56edf817eba4367a5c561723c").".py";
		$path2=md5($uname."7fa224e56edf817eba4367a5c561723c").".py";
        $myfile = fopen($path, "w");
        fwrite($myfile,$answer);
        fclose($myfile);
		$str="python /opt/jail/home/qlcoder/onlinejudge/task_142_zigzag/command_check.py task_142_zigzag ".$path2." 10000 65536";
		$res = exec($str,$output);
		if(strlen($output[0])>300){
			return;
		}
		$data=json_decode($output[0],true);

		$limit_len = 200;
    	foreach($data as $k=>$v){
			if(strlen($k)>$limit_len || strlen($v)>$limit_len){
				unset($data[$k]);
				$k = substr($k,0,$limit_len);
				$v = substr($v,0,$limit_len);
				$data[$k]=$v;
			}   
		} 

        $this->hint=var_export($data,true);
		if($data['suc']==0)return;
		$rat=$data['ratio'];
		if($rat>0.8)
		{
			$this->hint="你的压缩比为".$rat.",压缩比大于0.8的方案无法通过";
			return;
		}
		$this->res=true;
		$this->hint="你的压缩比为".$rat;
		$this->score=intval($rat*10000);
	}

	private function t143($answer, $uid, $info)
	{

        $data = array();
        $data['created_at'] = date("Y-m-d H:i:s");
        $data['updated_at'] = date("Y-m-d H:i:s");
        $data['userid'] =$uid;
        $data['taskid'] = 143;
        $data['lan'] = $info['lan'];
        $data['code'] = $answer;
        $data['judge_info'] = "";
        $data['status'] = 0;
		if($info['size']=="small")
		{
			Judgetask::create($data);
		}
		else
		{
			$data['datatype']='small';
			Judgetask::create($data);

			$data['datatype']='medium';
			Judgetask::create($data);
			$data['datatype']='large';
			Judgetask::create($data);
		}
		
        $this->hint='<a href="http://www.qlcoder.com/judge/status?page=1">url</a>';

	}	

	private function t140($answer,$uname)
	{
		$path="/usr/local/pypy/pypy/sandbox/task_140_python_map/user_codes/".md5($uname."7fa224e56edf817eba4367a5c561723c")."3.py";
        $myfile = fopen($path, "w");
        fwrite($myfile,$answer);
        fclose($myfile);
		$res = exec("python /usr/local/pypy/pypy/sandbox/task_140_python_map/command_check.py ".$path,$output);
		log::info("python /usr/local/pypy/pypy/sandbox/task_140_python_map/command_check.py ".$path);
		$err="";
		for($i=0;$i<count($output);$i++)$err.=$output[$i];
        $this->hint=$err;
		if(strpos($err,'writecnt')>0)
		{
			$err=str_replace('\'','"',$err);
			$arr=json_decode($err,true);
			if($arr['suc']==0)return;
			$wc=intval($arr['writecnt']);
			if($wc<200000)
			{
				$this->hint="恭喜你成功利用持久化通过此题,总共随机写文件了".$wc."byte。";
				$this->res=true;
				$this->score=$wc;
			}
			else
			{
				  $this->hint="恭喜你成功利用持久化保证了计数器的正确性，但是由于读写磁盘次数太多导致效率低下，无法通过此题。";
			}
		}
	}
	private function t139($answer,$uname)
	{
        $path="/usr/local/pypy/pypy/sandbox/task_139_sanbox_escape/user_codes/".md5($uname."7fa224e56edf817eba4367a5c561723c")."2.py";
        $myfile = fopen($path, "w");
        fwrite($myfile,$answer);
        fclose($myfile);
		$res = exec("python /usr/local/pypy/pypy/sandbox/task_139_sanbox_escape/command_check.py ".$path,$output);
		$err="";
		for($i=1;$i<count($output);$i++)$err.=$output[$i].'<br>';
        $this->hint="auth.py并未被执行,错误信息以及输出如下:".$err;
		if(false)
		{
			$this->hint="恭喜你成功沙箱逃逸，通过此题";
			$this->res=true;
		}
	}
	private function t138($answer,$uname)
	{
        $path="/root/test/".md5($uname."7fa224e56edf817eba4367a5c561723c").".py";
        $myfile = fopen($path, "w");
        fwrite($myfile,$answer);
        fclose($myfile);
		$res = exec("python /usr/local/pypy/pypy/sandbox/task_138_sort_encode/command_check.py ".$path,$output);
		$err="";
		for($i=1;$i<count($output);$i++)$err.=$output[$i];

		if(count($output)>=2&&is_numeric($output[1]))
		{
			$v=floatval($output[1]);
			if($v<1.3)
			{
				$this->res=true;
				$this->score=intval($v*100);
				$this->hint="恭喜你，你的膨胀率是".sprintf("%.2f",$v);
			}
			else 
			$this->hint="膨胀率过高，这并不是一个好的方案，你的膨胀率是".sprintf("%.2f",$v);
		}
		else
		{
			$this->hint=$err;
		}
	}

    private function t18($answer)
    {
        $answer = trim($answer);
        $arr = explode("-", $answer);
        if (intval($arr[0]) >= 176
            && intval($arr[0]) <= 181
            && intval($arr[1]) <= 225
            && intval($arr[1]) >= 221
            && intval($arr[2]) <= 232
            && intval($arr[2]) >= 228
        )
            $this->res = true;
    }

	private static function gao($url)
	{
		$s=file_get_contents($url);
		$pos1=strpos($s,'<pre id="output-text">');
		$s=substr($s,$pos1);
		$pos2=strpos($s,'</pre>');
		$s=substr($s,22,$pos2-22);
		$s=html_entity_decode($s);
		return $s;
	}
    private function t124($answer)
    {
		//$this->hint="判题太慢了，重制ing，请稍后提交";
		//return;
$t1=time();
		$arr=explode('-',$answer);
		var_dump(count($arr));
		if(count($arr)!=3)
		{
			echo "格式不对";
			return;
		}
		Log::info("t124-0");
$s1=file_get_contents("http://ideone.com/plain/".$arr[0]);
		Log::info("t124-1");
$s2=self::gao("http://ideone.com/".$arr[0]);
		Log::info("t124-2");
$s3=file_get_contents("http://ideone.com/plain/".$arr[1]);
		Log::info("t124-3");
$s4=self::gao("http://ideone.com/".$arr[1]);
		Log::info("t124-4");
$s5=file_get_contents("http://ideone.com/plain/".$arr[2]);
		Log::info("t124-5");
$s6=self::gao("http://ideone.com/".$arr[2]);
		Log::info("t124-6");
		$s2=substr($s2,0,min(strlen($s2),strlen($s3)));
		$s3=substr($s3,0,min(strlen($s2),strlen($s3)));
		$s4=substr($s4,0,min(strlen($s4),strlen($s5)));
		$s5=substr($s5,0,min(strlen($s4),strlen($s5)));
		$s6=substr($s6,0,min(strlen($s6),strlen($s1)));
		$s1=substr($s1,0,min(strlen($s6),strlen($s1)));
$t2=time();
Log::info("t124-".($t2-$t1));
		if($s2==$s3&&$s4==$s5&&$s6==$s1)
		{
			
			$this->res=true;
		}

    }

    private function t20($answer)
    {
        $answer = trim($answer);
        if ($answer == "passbook")
            $this->res = true;
    }

    private function t23($answer)
    {
        $ans = floatval($answer);
        if ($ans >= 1460 && $ans <= 1470) {
            $this->res = true;
        }
    }

    private function t25($answer)
    {
        $arr = array(0, 509, 838, 924, 650, 604, 793, 564, 651, 697, 649, 747, 787, 701, 605, 644);
        $brr = explode("-", $answer);
        $sum = 0;
        for ($i = count($brr) - 1; $i >= 0; $i--) {
            $a = intval($brr[$i]);
            if ($a > 15 or $a < 1) {
                $this->hint = "输入错误,没有id为" . $brr[$i] . "的货物\n";
                return;
            }
            for ($j = $i - 1; $j >= 0; $j--) {
                if ($brr[$i] == $brr[$j]) {
                    $this->hint = "输入错误,货物编号" . $brr[$i] . "出现了多次\n";
                    return;
                }
            }
            $sum += $arr[$a];
        }
        if ($sum > 5000) {
            $this->hint = "隔壁老王超载被抓了...\n";
            return;
        }
        $this->res = true;
        $this->score = $sum;
        $this->hint = "Woo~,恭喜你,隔壁老王在你的帮助下一次装了" . $sum . "公斤的货物\n";

    }
	private function t127($answer,$uname)
	{
		$str=md5("qlcoder_".$uname."_0509");
		if($str==$answer)
		{
			$this->res=true;
		}
	}
    private function t27($answer, $uname)
    {
        try {
            $output = file_get_contents($answer);
            $output = trim($output);
			$uname=trim($uname);
            if ($output == "shinian") $this->hint = "少年，你也叫食年么...!";
            else if ($output == $uname) $this->res = true;
            else $this->hint = " 网页上的内容与你的用户名不匹配 ";
        } catch (Exception $e) {
            $this->hint = " 您提交的页面[" . $answer . "]无法打开 ";
        }
		//$this->hint=$output." ".strlen($output)." ".$uname." ".strlen($uname);

    }

    private function t28($answer)
    {
        try {
            $output = file_get_contents($answer . "?a=55&b=83");
            $output = trim($output);
            if ($output == "4565") $this->res = true;
            else $this->hint = " 网页上的内容不对哦 ";
        } catch (Exception $e) {
            $this->hint = " 您提交的页面[" . $answer . "]无法打开 ";
        }
    }

    private function t31($answer)
    {
        $id = explode("\n", file_get_contents('/root/work/public/1.txt'));
		try
		{
        for ($i = 0; $i < 100; $i++) {
            $ans = mb_ereg($answer, $id[$i]);
            if ($ans == 0) {
                $this->hint = " 身份证号:" . $id[$i] . " 判断错误 ";
                return;
            }
        }

        $id = explode("\n", file_get_contents('/root/work/public/0.txt'));
        for ($i = 0; $i < 100; $i++) {
            $ans = mb_ereg($answer, $id[$i]);
            if ($ans == 1) {
                $this->hint = " 身份证号:" . $id[$i] . " 判断错误 ";
                return;
            }
        }
		}catch(Exception $e)
			{
				$this->hint="正则语法有误";
				return;
			}
        $this->res = true;
        $this->score = strlen($ans);
    }

    private function t34($answer, $uname)
    {
        $ans = md5("ql" . md5($uname) . "coder");
        if ($ans == $answer) $this->res = true;
    }

    private function t35($answer)
    {
        $Parsedown = new Parsedown();
        $m = $Parsedown->text($answer);
        $s1 = strlen($answer);
        if ($s1 > 3500 && $s1 < 5000 && strlen($m) > 5000) {
            $this->res = true;
            $this->hint = "恭喜你顺利掌握了markdown";
        } else if ($s1 > 5000) {
            $this->hint = "你提交的markdown代码太冗长了,可否再缩短一点么";
        } else if (strlen($m) <= 5000) {
            //$this->hint="以下是您的markdown最终生成的html片段,和最终的html片段有较大的出入,请查看源码和题目中给出比的页面进行比对";
            $this->hint = "和最终的html片段有较大的出入";
            //$this->hint.=$m;
        }

    }

    private function t36($answer)
    {
        $answer = trim($answer);
        if ($answer == "youarereallygenius")
            $this->res = true;
    }

    private function t37($answer)
    {
        $answer = trim($answer);
        if ($answer == "3472242696" ||
            $answer == "3155345231" ||
            $answer == "3329984401"
        ) $this->res = true;
    }

    private function t41($answer)
    {
		Log::info($answer);
        $pdata = explode("\n", file_get_contents('/root/work/public/uploads/passenger.txt'));
        $px = array();
        $py = array();
        for ($i = 0; $i < 50; $i++) {
            $loc = explode(" ", $pdata[$i]);
            $px["P" . ($i + 1)] = $loc[0];
            $py["P" . ($i + 1)] = $loc[1];
        }


        $udata = explode("\n", file_get_contents('/root/work/public/uploads/ubercar.txt'));
        $ux = array();
        $uy = array();
        for ($i = 0; $i < 100; $i++) {
            $loc = explode(" ", $udata[$i]);
            $ux["U" . ($i + 1)] = $loc[0];
            $uy["U" . ($i + 1)] = $loc[1];
        }


        $arr = explode("\n", $answer);
		if(count($arr)!=50)
		{
			$this->hint="提交的答案格式不对".strlen($answer);
			return;
		}

        $ps = array();
        $i = 0;
        foreach ($arr as $a) {
            $brr = explode("-", trim($a));
            if (isset($ps[$brr[0]])) {
                $this->hint = "乘客" . $brr[0] . "重复上了多辆车...";
                return;
            }
            $ps[$brr[0]] = $brr[1];
            if (!isset($px[$brr[0]])) {
                $this->hint = "不存在乘客:" . $brr[0];
                return;
            }
            if (!isset($ux[$brr[1]])) {
                $this->hint = "不存在uber车辆:" . $brr[1];
                return;
            }
        }
        if (count($ps) != 50) {
            for ($i = 1; $i < 51; $i++) {
                if (!isset($ps["P" . $i])) {
                    $this->hint = "乘客P" . $i . "没有上车哦";
                    return;
                }
            }
        }
        for ($i = 1; $i < 51; $i++) {
            for ($j = $i + 1; $j < 51; $j++) {
                if ($ps["P" . $i] == $ps["P" . $j]) {
                    $this->hint = "乘客P" . $i . " 和乘客P" . $j . "拼车了！这怎么可以呢！";
                    return;
                }
            }
        }
        $ans = 0;
        foreach ($ps as $k => $v) {
            $dx = ($px[$k] - $ux[$v]) * ($px[$k] - $ux[$v]);
            $dy = ($py[$k] - $uy[$v]) * ($py[$k] - $uy[$v]);
            $d = sqrt($dx + $dy);

            $ans += $d;
        }
        $this->res = true;
        $this->score = intval($ans * 10);
        $this->hint = "成功匹配了所有的乘客，该方案使50个司机开的总路程为:" . ($this->score / 10) . "百米";

    }

    private function t43($answer)
    {
        $answer = trim($answer);
        if ($answer == "PIAZZA DEL POPOLO")
            $this->res = true;
    }

    private function t45($answer)
    {
        $answer = trim($answer);
        if ($answer == "2621440")
            $this->res = true;
    }

    private function t46($answer)
    {
        $answer = trim($answer);
        if ($answer == "Squid")
            $this->res = true;
    }

    private function t47($answer)
    {
        if ($answer / 35157330064 > 0.9999 && $answer / 35157330064 < 1.0001) $this->res = true;
    }

    private function t48($answer)
    {
        $answer = trim($answer);
        if ($answer == "fugu")
            $this->res = true;
    }

    private function t49($answer)
    {
        $answer = trim($answer);
        if ($answer == "1100001111111000110000100100111100101111" ||
            $answer == "1111011110001100011011110100100011011110"
        )
            $this->res = true;
    }

    private function t50($answer)
    {
        $answer = trim($answer);
        if ($answer == "84629")
            $this->res = true;
    }

    private function t51($answer)
    {
        $answer = trim($answer);
        if ($answer == "N3B11N1A1N5B4A2^1A13H1A9|1H1" ||
            $answer == "N3B9B2N1A1N5B4A2^1A9A4H1A9|1H1"
        )
            $this->res = true;
    }

    private function t52($answer)
    {
        $answer = trim($answer);
        $answer = intval($answer);
        if ($answer <= 39490 && $answer >= 39480)
            $this->res = true;
    }

    private function t53($answer)
    {
        $answer = trim($answer);
        if ($answer == "Isaac Asimov")
            $this->res = true;
    }

    private function t54($answer)
    {
        $answer = trim($answer);
        if ($answer == "EasyCoin")
            $this->res = true;
    }

    private function t55($answer)
    {
        $answer = trim($answer);
        if ($answer == "E921775")
            $this->res = true;
    }

    private function t56($answer)
    {
        $answer = trim($answer);
        if ($answer == "45a60b91b9faaebced29580e7e17a31c")
            $this->res = true;
    }

    private function t57($answer)
    {
        $answer = trim($answer);
        if ($answer == "ridiculous")
            $this->res = true;
    }

    private function t58($answer)
    {
        $answer = trim($answer);
        if ($answer == "gold.xitu.io")
            $this->res = true;
    }

    private function t59($answer)
    {
        try {
            $output1 = file_get_contents($answer . "?registerusername=czechoslovakia");
            $output1 = trim($output1);
            $output2 = file_get_contents($answer . "?registerusername=hamlet");
            $output2 = trim($output2);

            $output3 = file_get_contents($answer . "?registerusername=hamlet");
            $output3 = trim($output3);

            $output4 = file_get_contents($answer . "?registerusername=czechoslovakia");
            $output4 = trim($output4);
            if ($output1 == "register success"
                && $output2 == "register success"
                && $output3 == "already used"
                && $output4 == "already used"
            ) $this->res = true;
            else $this->hint = "网页上的内容不对哦,请清空持久化存储重新尝试";
        } catch (Exception $e) {
            $this->hint = " 您提交的页面[" . $answer . "]无法打开 ";
        }
    }

    private function t60($answer)
    {
        $answer = trim($answer);
        if ($answer == "6026562951,10")
            $this->res = true;
    }

    private function t61($answer)
    {
        $answer = trim($answer);
        if ($answer == "ClassicalCryptography")
            $this->res = true;
    }

    private function t62($answer)
    {
        $answer = trim($answer);
        if ($answer == "WORLDWAR")
            $this->res = true;
    }

    private function t63($answer)
    {
        $answer = trim($answer);
        if ($answer == "821-319")
            $this->res = true;
    }

    private function t64($answer)
    {
        $answer = trim($answer);
        if ($answer == "134354498349854354498572607258498349857260725849854354498349854343")
            $this->res = true;
    }

    private function t65($answer)
    {
        $answer = trim($answer);
        if ($answer == "d3js.org")
            $this->res = true;
    }

    private function t66($answer)
    {
        $answer = trim($answer);
        if ($answer == "RFC2049")
            $this->res = true;
    }

    private function t67($answer)
    {
        $answer = trim($answer);
        if ($answer == "39.150,153.068")
            $this->res = true;
    }

    private function t68($answer)
    {
        $answer = trim($answer);
        if ($answer == "JOIE")
            $this->res = true;
    }

    private function t70($answer)
    {
        $answer = trim($answer);
        if ($answer == "bitoperation^|")
            $this->res = true;
    }

    private function t71($answer)
    {
        $answer = trim($answer);
        if ($answer == "threesum")
            $this->res = true;
    }

    private function t72($answer)
    {
        $a = new Qll();
        $a->run($answer);
        $ans = $a->output();
		$word="Hello, World!";
        if ($ans == 'Hello, World!') {
            $this->res = true;
            $this->hint = "恭喜你顺利通过了此题，你的代码长度为:" . strlen($answer);
            $this->score = strlen($answer);
        } else {
            $this->hint = "答案错误,以下是输出信息:<br>" . $ans;
        }
    }

    private function t73($answer)
    {
        if (strlen($answer) >= 120) {
            $this->hint = "你的代码太长了";
            return;
        }
        $a = new Qllb();
        $a->run($answer);
        $ans = $a->output();
        if ($ans == "0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025,121393,196418,317811,514229,832040,1346269,2178309,3524578,5702887,9227465,14930352,24157817,39088169,63245986,102334155,165580141,267914296") {
            $this->res = true;
            $this->hint = "恭喜你顺利通过了此题，你的代码长度为:" . strlen($answer);
            $this->score = strlen($answer);
        } else {
            $this->hint = "答案错误,以下是输出信息:<br>" . $ans;
        }
    }

    private function t74($answer)
    {
        $answer = trim($answer);
        if ($answer == "901566818")
            $this->res = true;
    }

    private function t76($answer)
    {
        if (strlen($answer) == 0) {
            $this->hint = "不接受空的字符串作为代码";
            return;
        }
        $a = new Qllc();
        $a->run($answer);
        $ans = $a->output();
        if ($ans == $answer) {
            $this->res = true;
            $this->hint = "恭喜你顺利通过了此题，你的代码长度为:" . strlen($answer);
            $this->score = strlen($answer);
        } else {
            $this->hint = "答案错误,以下是输出信息:<br>" . $ans;
        }
    }

    private function t77($answer)
    {
        $answer = trim($answer);
        if ($answer == "667.848,923.002")
            $this->res = true;
    }

    private function t78($answer)
    {
        $answer = trim($answer);
        try {
            $data = json_decode($answer, true);
            if ($data["name"] == "Sayalic"
                && $data["gayfriend"]["name"] == "dploop"
            )
                $this->res = true;
        } catch (Exception $e) {
            $this->hint = "json格式解析错误:" . $e->getmessage();
        }
    }

    private function t81($answer)
    {
        $c = "0000000000001000000000000000010000000010000000001000101000000100000100100001011010010011101101010010011000000000010000010101000000110000001000000010010000011000001010100000010000010000000000000100000000000000001001000001000000111000000100100010100001000000010000000000000001100000100001001100101100000010000000000011001000100000001000000011100000001000010011100001111100000000110100000011000000100110100000001010100000010000000000001000000010011110001100000100001001001001000001000000110000110000000000001000100000000000010101001000000010000111100000000101000000000010000000110000000100000000000000000010001000010000010100101000001110111100010000000101000010000000000000011010000100000101010000110000000000010000000011100000010000000001010001000000100000001000110001000011000010100100000010000000101100101011000000100010010001000000000000110001010000000000000000001111010010010000000011100110000000010001001110000100000000011101001000001000000011000000000110000000000100000100100000011100000000110010";
        $answer = trim($answer);
        if (strlen($answer) != 1000) {
            $this->hint = "答案长度不对,应该是1个长度为1000的字符串";
            return;
        }
        $cnt = 0;
        for ($i = 0; $i < 1000; $i++) {
            if ($answer[$i] == $c[$i]) $cnt++;
        }
        if ($cnt > 800) {
            $this->hint = "恭喜你,通过了此题,你的准确率为" . ($cnt / 10) . "%";
            $this->res = true;
        } else if ($cnt > 650) {
            $this->hint = "你的准确率目前在65%-80%之间";
        } else if ($cnt > 500) {
            $this->hint = "你的准确率目前在50%-65%之间";
        } else $this->hint = "你的准确率目前低于50%";
    }

    private function t82($answer)
    {
        $answer = trim($answer);
        if ($answer == "Kakkl")
            $this->res = true;
    }

    private function t83($answer)
    {
        $answer = trim($answer);
        if ($answer == "notbyhand")
            $this->res = true;
    }

    private function t86($answer)
    {
        $answer = trim($answer);
        if ($answer == "FFFFFFFD")
            $this->res = true;
    }

    private function t87($answer)
    {
        $answer = trim($answer);
        if ($answer == "62162326")
            $this->res = true;
    }

    private function t88($answer)
    {
        $answer = trim($answer);
        $answer = intval($answer);
        if ($answer == 150000)
            $this->res = true;
    }

    private function t89($answer)
    {
        $answer = trim($answer);
        if ($answer == "705.178")
            $this->res = true;
    }

    private function t90($answer)
    {
        $c = "100001100110011011101000001001001001000111100100110000001010010101011101110110101000011011100001011110111001101001000100000011001001110010111010000000001101001101010010001000110001000101001000010000110010000010100001011001011011000000111010101101111000100010010010000011001110111101100001001001000000100011100001010100000001000111111011010001100100010000010001001001000110110100100010100011000111110111011001000110011001111110010001001001000000100000100000000101000001010010011010110110010011000000100010010110001010010101100001000011010011110011111010111101011000011110011001101000100111100011010110001001011001001101001000000000001100001011111011011111001111010010000100110011001011100000001100100110101100000110111111110000001110010110010000101101110000001110110011100111111001111010000011101100010100001011100100011001111111110010110011000100100100010001001001000000001000110000000010110111110111010001101101011000100110110111000101110110010011010000111001100011111100100000000100000000011100110010001111001010001111000000101001100000001010000100110000110011010001100010100100111010000010000101001111000111000000100000111000010000000011001111000001010111000001011100111111010101101111011110011101101100011000001001010010011100101001100000010100000110110101101110001010111000001010010010001011011010100101000111010110011010000010110101111100111000110001011001000000000000100001100101000100111011010100110000000111101000010000110010000110101101100110010001100001000011101000000111110100111110111000010010001011110110010001110101101001100000101000000101010110000001111110001000111001100111111001101000100010110111101010100100011000100000001100101010001000000100001100001100110111100011010110111110000001110101011110100110000111100100101100001000000101001111001111000000000001110110000001111100001001000111000001000011100100011100010100010111001010000001010011001010011101010000100011101101010001110100100100101001101000100111000000010100101111111011011101001000100010001000110111000101011100001011000001011110100100111010010000110011000001101010111101100100101000001000100010010011111111100110110100100000100000100000010010000010101100011000001010011111000100000100011110101010010110100001000101001100110000101101110110010001110010001100100010000000101000110001110000101001011001010010000000000101000010101101001110000000000101011100110101100011000100000101111010101010010011010010110100000000001011100110100010000111000000101000001110101101111110111001011001010000011100001110110101000001111011010100101101110001100111010100101111100001011111101010001111101101010010010010001001001111001000000011000010011000001100010110100010111010100001001001001000001000101100000000011100000100011011000100111010101000101111000000110111100011101001101010111011010001100111000110101100001001000011000101110001011101001111100110000010001000000010000000110010101101010001111001100101110111000000000011101001100010000100001110100101010010100100010110101000001010010110000101011101000000100000010010011000000000001001010100100110001011010001011100010101110010010010001111100101010110010111101001000110100101011111101001001100010111110101000000110000000101111011001000010000010100010100100011101011101110111100001011011001010110011011010101000100111000100110110101010100110100110100000011000100110001001001011110110001010010010000100101100010110100101010001011110011000111001011001110010010010010011111111011100100011000001110001100100101101011111000000010110110001101000000110000110100000100010010100000010110010100100000101001001110101001110001010000001000010001110010101101011000110110000001001110110000010000110100111010101011000110010000101111000011001010100110100001010100001010110001010110100010011001101010010111111010101000111001101011111101001101011010011111101010001010010100010000000011001010011010100110001011000010101110011100000000011100001101110101100000001000000001010000101101000000110100100110100001000000001000101010111110101100000010011101111001011000110111100010010010110110001001111110111011101000100111101000000000111000101011001100000010010000010000000000010011010011011000110110001000010100101010110000011101001111000100000101000010101100000001100001101010011000100111010100001010010110001101000000011101000001100010000001001111011100010111011101100100110010110100111010100001010100100001011110000011100101000100011111001100111010010000100001011110101000110000011001000011000101101110000111000101100101010110010000010110101100100001101111010010000100000110110110110110100100110101011000100000101000101001001000110000111011101110101111111010101101001010010011100011111010001010110000110001100100010001100101000111110110101010101111100001011010101011001100101001110010100001010000001000000010000000000000010010000001111001010100000000010110100100011000110110100110111111011101010000000100010101011001100101000001000100011011110111000110001100001001101001001110111100101101101100010101010010101101011000000101101111001111100010110001100111100000110001100000011010000001100000000110000000111011011001000010100101010000110000000010110111101000101111000011100010010011010101111111001000111010000110010111111110011000100100010001110010101011001100001010011000110111100110111101100101001011100100010110000010000010100001010101000110000011001010001000000011010010110000011010100101101010110010011001110011011000101101110110010001101010110011110000100000111010001001010000110000011000101100111011001011011000100110000110100001001001001011011101011100000001001010100011001111010110100111001000100000000100111000010100101100010101010111010000010111101001111010100100101010000101100001110101101011100000100100001010101011000000000001111001110010101101001010000010000010101010011100000100000000100100000111000011110110000011000001001000010000000100010010011010001111101101011100100110000001001000100011000001000010000001101010010111010111101000101100110110110101010001100010000010001100000100111000111010001010000001001010000000001010110011010000011110010000001001000110101011010100010100110101011001011011101010001100101010100100001000010000000110110101100111100000010010010000100011010111000100100011100101011101011110100010010101101000010011111100000101110100101111100001001100000011100010111101000000010001110000000101110110100000100001110100100000001110010000000110100101100000101000011001000100111100000010001110101110100000110110110000011001110000100110101001111101101010011010101100011110011001001000000110010100000000111001011100111100111110001001011000001001000100101100000000000010101101111010011001100010000000101010001001111011000010101010111000101010010000100010101111111101001110011001000111110110100110101000010101010011000100011001000001110001001100010001111001100010100101100001011011110110110101001000110100101000001110101101101000111000001010011010101000110010011010100001000110100001110100001001000000011000101001000111110010001111100100010100101001100110101000110010010001000100101000011011000101100100001100010010011011101000010011110110100100000000111101101100110100010010001010100011011001011010101100101110100100010110010000000010110100000001000001100110001111000011000011110111100001000011111001011001101010010110001111110000110100011011010011001000001010100000001001000011000100100001000010100111100110001010011000001101010101000000000001001000000111101000101000100110001011000100001100001001011001000111000100100010000000100100011000001000100000011000110010001100000111000000000111010100100001000100100101011000001101110111101101001101000010110000111000011010000000001000000000010000001000011001010110001111000011011011111011101100101000010100100000111010100101110111011010001011111010111000001001000111100110101110110011011100100110000010100101000011011111000111001110011110011010111111010001011001010110100001000110110010000100000110101001011010110000001010110000111001010010101010010111001111101011010110001110000100010011001111010100011110111111001100000110100101110001111111011001001110101111010001011001000100110100011000100001001100100110010100111010011100000000001000100001100110100111000011000111000011110010011011101000110000001110000100110000011010000100011100011100011001101101010000000000011110110100010010000001001100111100010111100110001110110001000001011011111110100010110110111101000001001000011001010111011000010001100001001010110000101000101001011101011100010100001110000000011111110011010001010100111010000000010100000100010110100010000010000010010011101101111100010101101110010100011011000111000111100100001011100000011101010101001011111000100100010000010110000101001010100000010011010110101111111101010010000110110100001111000111011000011000100000101101000100101000000110101100001111110100101001110011001000101001100100000101001110011000000101100000100100010100110100010111000110010110101000100010100100011001011011010010111110000001110110000100110101010000001011001011011000110101110001101010110000001000001100100011000010001100000000011111000111011101100101100011111111010001101010000100100001001011001010010000000010111011000100000100000011000100100011001010001011010110111011100000010101011111100101010100000011000100010000000111100001101111011111011010100000000001001000100101001010100000010110000011100010000111101100001101111000000110011100001110110101100111000011000000000001011010010010010000100001101010110111010001110101100011010011101001110001010100100001000100001010000100101010111100000010001010110011100000111000010100111110100000101000011011010110011001001101011011011001110000011101000001100100100100111000101100000011000011100110010011100101101100100110011001010101000000000100111111110100010111101011111011001000000010100001110101011100000000011001101000110000010000101110011001111000000010010000010000001010011000100101110110110010110010111000000111111000010001101101100010000000011001000100110010000101110111111101001000110011101001100011100011011001000001100110001111000000111010010011000000010101011000110000001000101000100100001000100011111001000100000000010001111100100110000011100101110111000001010101000011111010010110100111110010110000000010010010000001111011101101011001000000100001000001110011010010010100101010001001010110101001110010000000000100001110100000000010100110011100101010010001011001001011111011001110000111000001011010100001010100111001000010000000000110011010100110000010101101111111011110100111000101001100111101110100010101010111111001010010110101101001000100111000010010010111011110100100000011101101110000001100110101100011010111101101110001100101000000110111000110001011110101100001110110100001011100100000110010010001001000011010111010110111001010001111110000010010010010101100000010101010001111010000011000001100011000001001100100011001011101101011111101101000011111100111011010101101110010011000011011001011000000000011111011000001001011010010100101010010110010011101001101010011101000110100100100001001001000000100101100011100111100101010110110000100000010000110000000101111001010011100101100100010010010000000000101110100010110011011000000010010011011000100010010110111010001000101101011000001000101001010000010110001000000010101111010101100101010001011010011001101000100010010100010100110101010101101001110101101111001000000001101111001000111001110000100110010010110101010000101011001110011000001110111101010100001011000001100101111100101111101011010001010110010010100001110000000010001010011100000110000101010111111000101110100000001011110101111100001101110111010010001100000010000101001100011000101111001010001100111010000000101001101010010100000000011001011111000110000101001100001000111011110110011010110000010110101100111100000101011001100111001101001100101000101000001110010101000010011000101101001100100000001101010100011010101101110101000111011000001101000100001010001100010010011110000110110010000010101000011010010111100110111000000110001011100101110001001010111111000011000010010001000000010010101011100110000100011010100000101100000101010110001010100100111101010100110100010101000101000100100111010010000000111000010100000011000010110111100000111010010011100010010000001100001010000111001010000111000000001010100100111110011011110110101000101100100010110001011001111100000000101100111110010101110001010100010010010001000110011111000100100100001110110010101010011111100011001011110010010110001111010100100101010001011110010100100010100101000000001011010001111000111001001000001000101001110110011110100010001100000010001010100010000000010110101001100111000010001011100100101100010110010110011010000000011010000001001101110101100001001011001101110000010100011000001011011101001001000010010000101011100110000011110110100001001000011001001111011110111011011000000110001011111001000010010100110111000100111000110000100000100010001001001111101000110001011100011010000100010100101010011101000000011101101110111000111001000100010001100010111000111001101000000011110010001101011101000100100100101100101110110110000000010100111001001011100001110011100111010111000000000101001110100000010010000000101011001010101101010001011111000000011110000000000011100000100000010101010100010011011101011011101011100010000111011000001011110011110001001000110011111001111100011111100111101010000001100000011001000101000000110011010000111000000111011010000001101001010100111000010010010010011110000000010111100101010011000000001001100001001101011110000010110001110011010001101100101111000110010000000110010101100011000001010100101100000010000111110100101000011110000110110100100101100001011101100011100100100100110001001001100010010010001011000010101100000100000000010011110101100111011101100001001111000000000001000010010000010101100101101101001000000010101001010000101100000101000001110011001110010000011001101101101101001110101000000101110010011001011101111011001100000111101000001000010010000101000011110001010000111101111001101101001011100001110111001010111101111001000010101111011011010111110000001100100001011010010101111101101011001000001111101111000100110010011100011011010011101011100001000001000101001000011000000100010010100011000111000000110101010110001101101010010011000110010001110110011000101110100000100000101010100111000001110101000000010100010000010001100110101110111100100101010001001100000010100001110111110010001010101000110100100110100001110111000110011010010010001100010101101100011010011101010100000111000010100111011011100001000010110010100110100000011010100001110100101101101101111001000001001110101010101110101110100110001001000001101001001000111010001000101000100000101111010000100011011011001101111100010101011000101101010000111011000001011010010111100110100001000100100001001100100110010110001000100100011001111011000110111000000111010001010010110100101001110001101100101010001001111000110110010100111100000100110111001100011010000010101100001010011001010001111011111101100010000011001110011011100001100001101110110010110010101100000011111010011000010011000101000101110010111000100001100011100010011110101010101001000111010011000111101110101100010000001011000100100010111111001001111000000010111011110110010100010011001010000111010010110110000011100000110001110001010001000111100110001011100010011010010110000000101000110011011110001110000001011000111010000011111110000001000011010101011001001100000101100000011001110110000100100000001010001000101101100010001010000000000110010110001011110000001100011001010100110101011001011100100011001000001000101010100111000000111011000111101001001000010110001011011010101011100001001101011100000110100011010100000000111000001100011110111010100110010001010000101000100100000010001011100110110000011001001111000111110111111000100101111001010000110000010100001111111000000111001101100111010011110101010110001001010110010001100100110010000011110000011101010100100101000001001110111101010110010000110110011101111000000010111100001010001101100010010000010000110000111000000100100110001111001100011000010111001001111010110010011100110001000100101101110110001101100000100110111000010101001101101101111000001000000101111100011011010001010100001000000000100011110001000110111000010110000010100100001100111010000110100000010000111010001001000010001010101010100110010011110010100110100110100011001011000110101011100011001100011100110100111000010110101010110000111000001011110100111110101001100110001001010110000001101001000010100000001000101010100100001100000101010101010010001101110010000001101001010000101101000000000111100011010100100000001010110000001010000000110001101100011011101110110100100100111100011010000101101001000000000111000101111110111111001111010000000010110000011100100100011101100011001011010000110001100000100100001101111000110011001101000001011011011111001010100000000011111111100001111110100001100000010101001100011000000001100010101010101000001101101000100010101100100000100101010110001011100000011001000010011001011110101111110010000111011011100011100000010011011110010110000110010101011001001000100101110000010010000110000010011000010000010100011100010111101000000000011101001011010100100010100000011101100101100011010010001011010110011110000010000100101110100110000101000001000011110100001110010000010001001100010001000110010100101001110101101010100100101101100010010011110001111110101100010100000100110101111111111001110010111111100101100001000001110000010010011000001100000101011100000111011101011000000001001111011010000100100101110110000010000101101100000110010001000001000110000000000101001101100101101101110100111001001001100100000100101011000010000111110001110000111011000001100111011000100011000010000010001010001110100110100010001101110000100000011000011011010000001011100000011100111100001010101001000101001010011011100101001001111001010100001100100100000110110110010010100010001101100000001110100100001001011101000101001000001110010000000000010010000111101110100011100000110010010110011100001100000101001001010011111100001001100000000101000101110111011000011011001001000001010001111010100100100010011010011000010100100110101011101001100111101101000110111110010011011010011010001010101000000000101111000010110000100000100101000001100111100011000011110100000010100010101010000111111010001100101010111100100000010100001011000001100101011001011000100111100111111010101010010010001000010000101010001111000100110010000000111100011101010001101110100110000001011011010101000110011001000100000010101100101101101001000001000000000101101000101001100010001001100100100110011101100010100001000110000110011100101000111100100111010001000000001001101011000011110100011111010010101111101101100100100011101101000000011101110000000100000110000001001010110000011001010011101100010000101011011101001001000101110011111101101001111100111001111001010011001000101011011010001001000001111101110011111010100010111110010101100110010000011001100011000010011000000010110010100111001000000010010100000100000101001000111010000100100010010001001101110011010101001011110100111011100001111000100011001001001101000101011100001100111010001100010110000100001001101011100010010010100110000000001000001111000110010001011100100000110010100110010111001010000011010010011010100010100101101000100100000000010100101001101100010101000010101100111001111100110010010111011100001000010010011101000101000001111110101010111100101111010100010011011100010000010011011101001000011001100111100111100001101001011101100100010100001000110101010011101101100101111100010101100001111100110101010111001001110001011000001001010001001010110011001111010100111011001100011001101010000111101100010000111110001000010001010100101011000000001011011011010000011001000001011100001111011111001001010001100101001000000000110000101100100000100111101001111010101010101001001101110010110010010100001101111000101001010011000000110100100000011111101001010110110110110110000111111011101000110001100110001111111001111111110110110011111011001000011111000000010000101101101100010000001100100001000000110010111110001011010011111111010101000100011011001000000011101100001110101110010100110111001101111010011001100000000101001001000000001111001010000110010011101010001010010000000000100001000011000011101011101001000001100100010101000010010010101101101011010000001100000100000000100110010000001011000000111110100010011011011001010000110001101000000000000100100101000010110000011101001111000100011011011101000000100000101011111000001000110100010001001100010111000000000011010000100101111100100000111011111000100000100101001100111011000100101011000110101001000000000100100101111000011100010000100100110101000000110001000100110101100010101001101100001011101000000000010001000010101000010010000111001110001001101110010001100000000000010111010011101001110100100100011010011010110110011001000110011011010111110100100000000011000011111101110111101011000100111000100011100101011111000110001001100011001100101001010000011101000000000100011100001101010011001110011111001001011011010000001101110100101111010010001000001010110011010110000010111100110100111100100010001011000000011001011000100000001010000110111000111001001110100101111110101101100011000000111010101100010100100001100011101111110000000010101010000001010111010011100011100010101000011100100001100001011101101000001001000000011001100000010100010000100110110110111000000110100011010000010101001110101111101000011010110010001101101100101010100010010101000000001001010000110101101001010000010010101001011101110100110010110000010101010011011001101101011100000101010001001010011110101000001010100010100011101110000100000111000001010101111111000110110011010100011101101110100100011011001000010001000010110101000010000110110101011111000000100111100000010000000110011101000110100000101001101011110100011001100101111100011010011010000010110100010011111100100110111110000011001101100000010001000011100101011101010110100010111011000000100110111100001110011101001011001001110111101111000010011110101010010010101001100011100110101110001000111101000000011011010011011011011011001100010010000111001011010100000001001010101100010010010001000000000001110110110110110010010001000101000010111110101000110001001000001111101010101011111011110011101000011010110110101010010110110001001100110100000011001000000001101001000001001110101010000001101111011000000011110010101010001110010111100101000011010000001100110010010101101001111110000100000101111110111100000001111010000011110110010001000000000000001010110011000001110010010110011011000010100001101000100010100111000001000100100001011110010001010001001100000100100010011010001000100011111001010111110101000011011110000001010000101000011100101100110010011001011110110010000001110000111000000111001110010000010111011010010110010100000110011010100011001011010011001001010001100111000011011111010000000111110100000011111000001000101110011000000010010100111010001100001010110101001100000100011111001010010001100000011101010101111000001010110001000110111001000000000010100000100001110101100100010001010000010100010110010000011110010000101110001011100000010100010100111100100001100110001011110001010011000100011100100010000011000011000001001001011110101001100110110111101001111111010010100011100100000110000010100000000000000101101101101111000101000010011001001001010010110010111011001100010101010010101101101100101010111010010000101010001010001001011001001110010101010100010100101011011100110010010000110111001110010100010011000010000001110000001010001000100111110001010110001010011111000001111001001000101111000111001100000101111000000000110100101101101011101111110010010110110110011011010001001110110001001100000001110100000001001010001001100110101010101000111001000101000100010010110111001101011011001010111000010110001100100001100101110110000110000100010001011111111010101010000001110000101110101100110000010001000100100111001010000000011110111110111001000000100000101010100000100011100010001000111000000000011101010110000001011100001010001110100111011001010100101100001011010101001111111000001110100001001010000000001100011011001101110010101100010001100011001100101010001001000110101011010010001001111101111101000111100011000101100010101011011010010010101010001100101000101110010010101110001110000111000100101011101001000101000000000011101001001001001101011010100110001010110110111011110101011000000001110000000111000111100100000110101001000111101010010111110001010101010001101011000001110000111100011010001001010000110001110001010101000011000001101100001101100000100100001001010100011100010110100001001100001000000011100111110001010101100101011001001011010101101101011100111000010011001011000100000000001110110010010100100011000000000000100100101000111111101010000101000110100001001100100000100011101110000110011010101000110010110101001100010000111111111111000010101010000011110001111101000111111100100000100110100000000010111111101110001110000000010011011000010011101010001001110101010001001100010011001010001111011100010111110001001010101011111100110010010111001101100010010111110110010001000110001110100001000110000000100011010000000101000101000011011011001010000111010000111010000000011110011001101011011110011011100010000001011101100001000001011010110110001101110000011011010000010010011010010001010111001101110001100010110110101010110001111100101001101001000001100100011001100100000100010001000000000110100000010101010101110010011011011101100001001000100101010000010010110101110101011101010010011000011011100001100101101011010100000011101001000110110101100101100000101000000001010011100010100000010100111010000000010000110010101100000001100000001001010101001000100000001000000101000110001000000001100000000000001100111101111001001110101100011001000001011111100010101100000010000000110110110000101001000000010000100100101010101110101101100110110111110101011000010111101001100011110100000011101110110000110010101010000001101100000100111111011010101111000100001000100011100100001110101011000001011010101110000001101010110001010000110101001011011111011100011000000010011011100000001110111001001001001010010011011001000001000001010010000011100010011000001000011110010001101010100101010110110111010000010110000110110101011100101000101001001001100010011111101010001001001000100100001001100110010011110111000000110010011111000101010110010010010111101011010100000011010001110100100111000000100100011111011010010100010110011101000010110011000000100110010100100001010011110001010010101101001011001001101110011010001011100000111010110000000100000110000110010001101010100010110010010111001110000101000011001010001110000001011110100001011100100000011010011110101100011001000111101000011101101010010100100110000001000010111000001100100111001111000100101011000001000101101111000111010101010000000011111100100011101110000000001000001100101000001011110000011100011011100000010111100001101010101110100111000001110110000101011000011001100000000110010100010011011111110001101001011001011101000001111101000001010010001000100011111100110010101001110100011000001000101101000001001110001100010100100100011001010011010110010100000011100000100001001101100010011001010000100010010010110010011111011101000000110100001110001110001011100000100011011010110001000010000011100001010011001111110110100001100111000011000000001010101111001000001010000001101010101100100110001000001000001110100110000100110111011100100001011111101001101110000101110100111100011011011101000101001101100101010000010000101011110100100010000111011000000101111000000101011110101010000111000100111010000100000001000000001111001111110010101110100011100110010000010100110100100101001000110000001001010101001101111010101001101111101010011100000100100000001111110000000010011100011000111100011010011111000001000111010010101100111011001001001011001110001100010000100011011100010101110000011101100010011011011101011011011100001011000000001100001101001110111110100000001101010001000100110000000100100100110100001000011000000110000000100100011010011100110001000011000110000000100001101100011000000000110100111001000001101011111110010110011110001011000000101110100000111101101000001100000000010011001110100101101000110101000111001010000100100100000001100000111001101011110011000110010011001110001001011001010001100000001011101000001010011010111000000011101001100101110110010011110010101001011001100100000101011001011101010011010101110100010110001000100111100000000010010110000001001000100100000010100000100011100100100001100001001010110100110101110000100111000101100011001111000110011100111001001001110011101100010110001100001001110000111010001000110001110110010111101010001110011100010000110011100001010110100011010010010000000100100001111110001011110110101111010010110001100001001100000010000011010011000111101111010110100011101010000100010100101101000001100100111100101010101000011000010000110111000110001110010011011000000100001101010011011100001001011111011010010000010101110011100110001100110010111100011001100011001110010000101000000010001101011100101011000001111000100101100001000100001001111010011110100000011110110001010101000101110010001011111000000011001110000100001110010011010000111110010001011111000010001000011100100000100001010010110110110101101001000010101010010001010011001100001011010000000000000000010101110111101110000010111010010011111100001101111111100010100110011000101011110001110111100100100000101001010011000000101000010011111011011101001000000111100001011111111110000100110011001000001101011111101011000001000000010001111010100100001001100110000000100111011111000000000100100001000100000110101001001000111011000001000011100101000110000000110001000000000110001001011010100011110101001100010100010111011110011110000011110100010101010000111010000101010011101101001001000001100001101110100011100100000000100110010011110111101000000010011110110100011001011100100110000111111010010011011011001101100100011010101011001000010101010110111000001010000001110100100001001110111000000000000001000001010110110111010000000100001100001101001000100101000110010000000110001000011101100001001001000111101110010001110101101001000001011000000000000100110010011000000010101001011010000111000000101011010111001001011000010000001001000011000111110100001001101011100000011001011001111010101001100010100010010010001111010010000111100010101101000001100111000110010111110100100111010101010111100101100111111100111001101101001000010000000011010000100000001000010000010011100011101001001100010";
        $answer = trim($answer);
        if (strlen($answer) != 30000) {
            $this->hint = "答案长度不对,应该是1个长度为30000的字符串";
            return;
        }
        $cnt = 0;
        for ($i = 0; $i < 30000; $i++) {
            if ($answer[$i] == $c[$i]) $cnt++;
        }
        if ($cnt >= 26400) {
            $this->hint = "恭喜你,通过了此题,你的准确率为" . ($cnt / 300) . "%";
            $this->score = $cnt;
            $this->res = true;
        } else if ($cnt >= 22500) {
            $this->hint = "你的准确率目前在75%-88%之间";
        } else if ($cnt >= 19500) {
            $this->hint = "你的准确率目前在65%-75%之间";
        } else if ($cnt >= 15000) {
            $this->hint = "你的准确率目前在50%-65%之间";
        } else $this->hint = "你的准确率目前低于50%";
    }

    private function t93($answer)
    {
        $answer = trim($answer);
        try {
            $data = json_decode($answer, true);
            if ($data['name'] == "沈正翔" && $data['qq'] == "447269857" && $data['tel'] == "13777359367")
                $this->res = true;
            else if ($data['name'] != "沈正翔") $this->hint = "错误的名字";
            else if ($data['qq'] != "447269857") $this->hint = "错误的qq号";
            else if ($data['tel'] == "15378172248") $this->hint = "这个手机号他已经不用了";
            else if ($data['tel'] != "13777359367") $this->hint = "错误的手机号";
        } catch (Exception $e) {
            $this->hint = "json格式解析错误:" . $e->getmessage();
        }


    }

    private function t94($answer)
    {
        $answer = trim($answer);
        if ($answer == "orangutan")
            $this->res = true;
    }

    private function t96($answer)
    {
        $arr = explode("-", $answer);
        $a = floatval($arr[0]);
        $b = floatval($arr[1]);
        if (count($arr) != 2) {
            $this->hint = "答案的格式不对";
            return;
        }
        $A = -1 * $a;
        $B = 1;
        $C = -1 * $b;

        $pdata = explode("\n", file_get_contents('/root/work/public/uploads/145613865992313.txt'));
        $sum = 0;
        for ($i = 0; $i < 1000; $i++) {
            $p = $pdata[$i];
            $brr = explode(" ", $p);
            $x = floatval($brr[0]);
            $y = floatval($brr[1]);
            $dis = abs(($A * $x + $B * $y + $C) / sqrt($A * $A + $B * $B));
            $sum += $dis;
        }
        if ($sum < 1300) {
            $this->hint = "所有点到该直线的距离和为" . $sum . ",恭喜你通过此题";
            $this->res = true;
        } else {
            $this->hint = "所有点到该直线的距离和为" . $sum . ",超过了题目设定的1300";
        }

    }

    private function t97($answer)
    {
        $arr = explode(":", $answer);
        if (count($arr) != 6) {
            $this->hint = "答案的格式不对";
            return;
        }
        $a = floatval($arr[0]);
        $b = floatval($arr[1]);
        $c = floatval($arr[2]);
        $d = floatval($arr[3]);
        $e = floatval($arr[4]);
        $f = floatval($arr[5]);
        $pdata = explode("\n", file_get_contents('/root/work/public/uploads/145622513871043.txt'));
        $sum = 0;
        for ($i = 0; $i < 10000; $i++) {
            $p = $pdata[$i];
            $brr = explode(" ", $p);
            $x = floatval($brr[0]);
            $y = floatval($brr[1]);
            $dis = abs($a * $x * $x * $x * $x * $x + $b * $x * $x * $x * $x + $c * $x * $x * $x + $d * $x * $x + $e * $x + $f - $y);
            $sum += $dis * $dis;
        }
        if ($sum <= 8195000) {
            $this->hint = "所有点到该直线的距离和为" . $sum . ",恭喜你通过此题";
            $this->res = true;
        } else {
            $this->hint = "所有点到该直线的距离和为" . $sum . ",超过了题目设定的8195000";
        }

    }

    private function t98($answer)
    {
        $str = "babaqunaer-shiziwang-beijingdaomangquanbeisonghui-xinhuashepimeirenyu-shibajiewuzhongquanhui-yinhangfaxinggupiao-yangguangjiemeitao-zhongquanbagongdegushi-wangpaiduiwangpai-shenmidewaimenggunvbingzhanxianjunzifengcai-youqiandezhongguorengengjiatuhaoqijuniuyueshizhuangzhoumaimaimai-xienajichangwurendali-xumuchanglishengchuduo-kasabulanka-wangbaoqiangqizi-haibianjiandaobaiwanjiezhi-tainvxingmengtinglibingshi-heiyingzhuiluo-qietingfengbao-meizhuanjiachengziyouanpaigongzuoshijianbangongduijiankanggengyouyi-tiaochuwotiandi-wanghongeyibeizaisha-gangdutoumubeibuhuamian-dashujuzhenghedianshangqiyecangpeijingdongdongchanrongzidanyuefangdaiepoyiyuan-qiwushi-zhangyixingzaopaiji-haiyang-shuqixueshengzhuangbanchujing-bayuemiqing-maidougushi-guodegangzhangziruyuan-nanzijiuyancusihuopei-dongjingwuyu-shuangseqiu-sunyuechezhenmen-langduzhe-baxiqicheshichangshuaituitongyonghuojiangchongxinkaolvxintouzi-longmao-nengyuanjuyuanfujuzhangdangtingfourenshouhui-lisisidelaogongweiwenbin-baibianwuxia-nvernashoujizuozuoye-huozhe-baogaochengchengzhenxuexiaojiaoshizhiyejuandaibixiangcunjiaoshigengyanzhong-shigezuiquenanrenguojia-nvzishahaiernvzisha-shelixinlixueyuanbeidayiliaonaojiankangjinjunxinlijiankangshichang-daomengkongjian-wangjinggongxizhouxingchi-weiyuewangluonvzhubojianmianzhainandaxueshengbeipianliangwanduoyuan-diliugan-jieyougongzhu-weizhongguoyuzouhong-helanhuochetuogui-taobao-fengkuangyuanshiren-liujialingjiduwangfei-liyixiaoqisuyexuan-sanshadanaobaolaiwu-linqingxiajinvhuaiyun-jimokongtingchunyuwan-dahuaxiyouzhiyueguangbaohe-faguancizhixinzouhong-meirenyu-kejibeidangyegoudasi-jialebihaidao-yinchefeidahuaiyunwuye-fengkuangdeshitou-xiaoshenkedejiushu-qianyuqianxun-huoyingshangyingkoubeiranbao-jiqirenzongdongyuan-shanghaihunjiatiaozheng-jingdong-chaoshijiagaimianzezhang-ribenmeizigudaoshengcun-wupeiciertaibairiyan-jinghunji-luochengjimi-jiandaoshouaidehua-tangweiwuxiuboxiuenai-yuxizhengchaojiangsunqiasi-yinengjinggongpolaitaipeiantaiqinhaodaierlaoguangjie-gongrentanyinlibozaofeng-muhelandao-dazhuzai-bianxinghouguimichengnvyou-meilixinling-wuhanlaoshixiaomenkoutiaoguangchangwuyingjiexueshengkaixuefanxiao-baidufanyi-hujunyijiaxizangbaifo-wanggoufangzhenqianghuowuqi-sanyazhiluanxiangyingyoukexinxinchunjielvyoushichangchangwang-sunzhijierentianjinhaiguanguanzhangqianrentianjingangshigudiaochashibinggu-honglajiao-tianmimi-chihuoguobixuyaoyoudelvseshucai-lvliqiji-jiaowomenyinyuedelaoshileyuzhuren-shekuangxintuoweihelunweitangshoushanyu-tiantangdianyingyuan-sharenhuiyi-xingxingshiyanhouzaodiuqi-yuanxiaojie-wangdazhihuoyingdi-chuanyueshikongdeshaonv-weixinwangyeban-malihemakesi-siwangshishe-jinyaner-suyuan-yuandaima-laopaoer-aikangguobinxuanbuqisumeiniandajiankang-shediaoyingxiongzhuanzhidongchengxijiu-dadushiderenkoudouhenduo-zhinengjiajurenqijianwang-daxiabeichengfenliqi-bingxuebao-beijingshijian-geshouhongbaihuibingshi-zhanzhengzhiwang-linzhilingqipaozhuangjingyan-mengzhianhunqu-nvzitianshenggongzhulian-luomajiari-yixianchengshiloushishangyankuanianfengkuanghuokechixudaoshangbannian-yijia-pinminkudebaiwanfuweng-tainvxingmengtinglibingshi-zhongguojunqing-lianlianbijiben-hushiduinanyouzhushesi-huangdaoyusheng-beijingguoan-kelanbaike-modaihuangdi-diyipangjianfeihuijia-yiyuanqingdan-wukequnzuishangshuobugenhechaolianfuheshentidaoshihenchengshi-cengjing-gaobai-yingguobingren-guowangdeyanjiang-woshigeshoudisiji-buxinglishitongxuejinxiao-xiaoshenyangtuichuxijuren-fuqindushujiumingqian-tengxunshipin-bawangbieji-qianchengwuyou-mengfeiyanglannuchiweishang-zhaoliyinglianqingzuoshi-jialijinzeinvzilengjingyingduitaochuxiaotoushenfenzhengdianhuahaoma-naxiangjipaizhizhubeixia-jiaofu-hubayichenkunbianshenjinjuwangzaofensishiaiqiushui-yuren-shuhoushiminchunjiemianfeicanguan-sichuanfashengliqichehuo-wujingzaohaiguankouliu-zhongminzhuyouyubiguiyuandingzhanlvehezuoxieyi-fangzhouzihuiyingdaoqianmen-ronglu-shigezuiquenanrenguojia-wangyoushaimajiangtangyuan-touguaiqiangpian-zhoudongyubiaobaiyuwenle-huangjinsanbiaoke-jingbaowangfeixiangyanqingshisishenghuozaoqidi-sadingdingjiachangzhuanhuatong-douyu-ertongpashouyuerushiwan-meilirensheng-zhuangche-chongqingxiaomianxiehuichengli-buzaijianfengbixiaoqu-yangweibeidashipinbaoguang-kadaishanjiemeibaoyinsi-zhongguoguangdayinhangjiujiangfenhangshengdakaiye-balitaoqibang-mengfeiyanglannuchiweishang-bingdaoyekongfenghuangjiguang-yangguangcanlanderizi-ribennvxingjianyafuwu-yuanxiaohetangyuandequbie-zhilianzhaopin-shangdiyefengkuang-zaicichufazhiniuyueyujianni-gulingjieshaoniansharenshijian-meirenyuchengxianzhiji-fanbingbingtishen-huanlexijurendierji-womenlia-shentounaiba-zhimingmoshu-baiduyun-qinglvditiedangzhongjiewen-chuqingshishi-shoulie-luanshijiaren-rili-yuantong-kuailedabenying-zhoudongyubiaobaiyuwenle-xiecheng-youku-meirenyuchengxianzhiji-zigongneitaierzidalian-wupeiciertaibairiyan-zhoudongyubiaobaiyuwenle-zhengjianbeijiaojingmoshouletarengxiangmeishiyiyang-shentong-xijiazhibo-zhonghanliangpiyikukaichang-yinyuezhisheng-gaoyuanyuanchaoshimaicai-ertongpashouyuerushiwan-meirenyuchengxianzhiji-meirenyupiaofang-xijia-chongqingsenlin-huyazhibo-shuhoushiminkemianfeitansuoshengmingaomi-yongcanbaodalinzhuonanzi-jiedongxidexiaorenaliaidi-nanzizaixinxianyezizhongdaoruguntangtieshuijieguojingdaile-rulianshi-hujunyijiaxizangbaifo-shousizhishen-wangdazhihuoyingdi-mahua-kejibeidangyegoudasi-xindeledemingdan-liangxiaowucai-zhegeshashoubutaileng-lanqiugongyuan-meirenyubaojilupian-liuyanhuashenmeiyanchuniang-zhaoliying-buxinglishitongxuejinxiao-zhiboba-shangdizhicheng-nvernashoujizuozuoye-chuzusijijiecaisharen-sanhaoxueshengshixiangzaopen-meirenyubaojilupian-xinwenlianbobiaoyangpaonan-zhangfukannenqihouzisha-guaishoudianligongsi-bianlian-jiezhangziyichanhoushoushenmijuelianyujiatifeinverqiqiu-sanlingyinqinangwentizhaohuibufenjinkoupajieluoqiche-xingxingshiyanhouzaodiuqi-xinchedaogou-benchigongsigaoguanbeiyaoqiukaixinnengyuancheshangban-langqiaoyimeng-chaojiwan-feiwuhuanyouji-tianshiaimeili-jiaoguanjuzhangbeipanwuqi-wanmeihuanqiulaobanyouxiyingshishuangxianbuju-yunnanlankongquebeixiasi-meiguoliren-suiyueshentou-buzaijianfengbixiaoqu-zhongguoyinhang-kongfangzhengren-liudongxiongyongjinshiweilingshouyegaoguannianchulizhi-maibaheyudishixiangzhuang-nvzishengqiannverguangjie-jingxianxuejuanqiguan-yankongweichengnianzhenrenxiu-luoshengmen-linzhilingqipaozhuangjingyan-hugewenshenyintucao-aikangguobinxuanbuqisumeiniandajiankang-beijingzuiniupengcige-dayu-jiamenkouwanshuabeizasi-baonongcuncailiannvhaixuelibiaojia-xiangshui-yuxizhengchaojiangsunqiasi-ribennvxingjianyafuwu-zigongneitaierzidalian-gongrentanyinlibozaofeng-luwangdafandian-dayuerchuanqi-xirelijiang-huayangnianhua-guizilaile-fujianyuananzhengrenchutinghoufafengcengzhizhengjingfangweizaozhengju-dianying-zigongneitaierzidalian-eyaoqiugaokejizhenchajifeiyuemeiguoshangkongyinfameidanyou-fumubihunjinglibaohong-qichezhijia-woaini-budanshouweiwangzidansheng-guodegangzhangziruyuan-hugewenshenyintucao-nanzijiuyancusihuopei-huanlexijuren-yongshi-shenzhenloushizhangfulingpaoquanguoyourenchengbaozhengdongloumanmanmai-yangweibeidashipinbaoguang-zhangyixingzaopaiji-yankongweichengnianzhenrenxiu-chenglixifunuxianzhuozi-yidalitongyimeiwurenjijidiqifeixianzhimeiwurenjijingong-xinhuashepimeirenyu-meirenyuchengxianzhiji-paonandisijimingdan-aganzhengzhuan-weimadebuwu-monvzhaijibian-jinbidao-hushiduinanyouzhushesi-zaijianliening-diqiushangdexingxing-zhongguowanggouejuquanqiushouweixiaofeichengjingjizengzhangdiyiqudongli-meixifanjibanchangbenxisushenzhongzhuqiangshoutaoguoyijie-yinghuochongzhimu-yicibieli-yongcanbaodalinzhuonanzi-chenmodegaoyang-haidaodiantai-zhihu-buzaijianfengbixiaoqu-pandianquanqiubukesiyideweijiezhimi-chenyixunmaidangnuotongtai-mozhatezhuan-dianyingtiantang-zigongneitaierzidalian-hugewenshenyintucao-ribennvxingjianyafuwu-kongbuyoulun-madelijingji-baiyishebaojijinrushi-dufanfuqichongzhuangjingfang-fanyi-wucaiyoumenzhicheshikong-haizeiwang-hushiduinanyouzhushesi-chulianzhejianxiaoshi-dieyingchongchong-xiaomiguanwang-renminbiduimeiyuanhuilv-fuqindushujiumingqian-tansuo-jiyisuipian-ranqingsuiyue-shikonglianlvren-jucilangdexiatian-bianxinghouguimichengnvyou-yuemeichengqixianxingjiaokeshupianfuyouxianjiangzengyuhuazhanzhengneirong-baiduditu-shigezuiquenanrenguojia-afeizhengchuan-zhangdechourongyichenggong-huangyeshengcun-zhaoliyingqiliuhaimeizhao-gaoyuanyuanchaoshimaicai-kejibeidangyegoudasi-linbihongweijibeicha-xindikuaichuxianladonglaoxiangmuhangqingbeijingwankeliaxiangmuxuanbuzhangjia-weiqiangyewuzhuiweibaoma-disuxiaoshuo-feiyuefengrenyuan-zhaoliyinglianqingbaoguang-zuqiuhuangdi-chenglixifunuxianzhuozi-dahuaxiyouzhidashengquqin-zuishuaikuaidixiaoge-yijiajifenbang-likaifulingxianzuozhenchuangtouquantianshiwanyanchuangtouhangyeyinglaichuntian-gengduo-taizifeilianqingyibaoguang-biezailongtangwannongxiaoniao-quanguoqiyexinyongxinxigongshixitong-diyipangjianfeihuijia-diyipangjianfeihuijia-qinglvditiedangzhongjiewen-zhengjiudabingruien-qiannvyouhun-xianggangdijiabaodieqicheng-pengranxindong-ceerqingting-heikediguo-beiyingfushiyanzhibaobiaoqishixichengdezhexieloupanyiyangmei-wanmeideshijie-zhenaizhishang-wangsicongpingdengchaoxinpian-hugewenshenyintucao-zhaoliyinglianqingzuoshi-chuantiaowenshuiyidenanhai-hudie-hurenbaotiaonanxishangnanyukongbaoxiaozhushuaizhengyuduiyishangtao-wuhuanzhige-quanzhougulituijinxinjianshangpinfangjingzhuangxiuzhixingzhufangbaoxiuqi-xunziweiguozhangfuzisha-kejibeidangyegoudasi-aiqiyi-chuangyanxiquxianbeiwushang-yankongweichengnianzhenrenxiu-weiershigongkaisai-jiaruaiyoutianyi-yangweibeidashipinbaoguang-renwudongtai-qingshu-wozaiyilangzhangda-nishiwodejiemei-ganjiwang-shunfeng-zhongyangchezhan-lingxiaosubanbairiyan-dongxiexidu-yindusongfanxiaogeruhechuangzaoguanlixueshangdeqiji-jinxingchulianbaoguang-hukoutuoxian-yangyi-lianggandayanqiang-meirenyubaojilupian-yulanggongwu-nvxinglianaiqibujia-shandongtianjiajiuhuche-fatiaocheng-zhuisui-soufangwang-linzhilingqipaozhuangjingyan-tailexianshenhaoyouhunli-hushiduinanyouzhushesi-huanqiushiye-mingxiaogaokaoyatibaoguang-tangbohudianqiuxiang-yuanxiao-kunlinglengyanxiezhenbaoguang-baoxueshougoutangguofensuichuanqikaifashang-zaixianfanyi-chengshizhiguang-sunzhijierentianjinhaiguanguanzhangqianrentianjingangshigudiaochashibinggu-yangweibeidashipinbaoguang-xixilidemeilichuanshuo-xunlonggaoshou-yashihuobeidiaoxiaopaizhao-qinglvditiedangzhongjiewen-meizhoubei-yingchaozhibo-bojijulebu-fangniubandechuntian-nvxingbaisutongku-pingbanzhicheng-ouzhoubei-rengongzhineng-zhaoliyinglianqingzuoshi-huoqishankuangzhuihechaolian-xunlei-lansedamen-nvyimingfeizhuan-yinghuozhisen-chubukeji-shangxiaodaojiaochangzhaorenjiaoduicailiao-beizuinankaodaxueluqu-xingxingshiyanhouzaodiuqi-zhegenanrenlaizidiqiu-maoshuyouxi-wangyoushaimajiangtangyuan-dianjujinghun-buyiyangdetiankong-meifangchaozuozhongguohuayangjiaojianleidaxuanranweixiechaoguodaodan-beisaoxianggangkaidianbeima-chibanmianniaojianchengyangxing-nongcuncailinachengcheng-xingfuzhongdianzhan-dejia-gangqinjia-xipudaluyimengxingshizenmedezainade-aomanyupianjian-meiguowangshi-yanweidie-fajia-wangyoushaimajiangtangyuan-afanda-zhaoliyinglianqingzuoshi-kadaishanjiemeibaoyinsi-meiguofeichengzhongguoliuxueshengyongzhongwenbobaomeidaxuelanqiuliansai-jiehoujianfeibiemangmuguanjianyangchenghaoxiguan-hudiexiaoying-shiernuhan-yongchuangduomingdao-bihailantian-jiajingwentiaokannver-yangweibeidashipinbaoguang-beixianqidesongzideyisheng-gongsidongtai-xinlongmenkezhan-congouzhoudaonanmeizhicaijiechuyilanghaozhiqianjinmaibuting-pinkunshengbaipailingbuzhujinxiaozhangbeiche-wubomuyangquanzaoqi-pingguoguanwang-feichangxianyifan-shigezuiquenanrenguojia-liaochunwanshoushikoubeigao-xiaoxueshengzaoxiaochenianya-jiayouzhanjiankongriyiwanshantezhonganfangyingyongqizhong-aizailimingpoxiaoqian-yuzhongqu-shaonianpaideqihuanpiaoliu-tianmao-baohadengshuaidiaokadaishan-jieyougongzhu-nvziqipalihunliyou-niansulicangzhekaogufaxian-zuiezhicheng-bingchuanshidai-xiyan-alibaba-nvhaiyinjiabaolijia-ribennvxingjianyafuwu-sunzhijierentianjinhaiguanguanzhangqianrentianjingangshigudiaochashibinggu-yaguan-zhangfukannenqihouzisha-dangxingfulaiqiaomen-wudipohuaiwang-mingxing-qingshe-heitiane-yefangxixiegui-jiaoyubutiduoxiaohuapian-nezhanaohai-shangyin-chunwanyizhujiangliangxiang-chunguangzhaxie-shaonianhuanbingsixixuegui-caihuoche-zuzongbei-haishanggangqinshi-huoyingrenzhe-changchunyatai-shenzhenchahuohuotilugui-hainangongbuchaosucheliang-xianghuaqianglitingtaitai-rangzidanfei-zhongguochengyudahui-modengshidai-chenlu-nvzizhibozisha-wohaiyaoqutushuguanhuanshu-zhonghanliangpiyikukaichang-aonier-xiaoshideairen-langchao-aizaixianluo-xinlangweibo-kekexili-xiaoxiezi-lianshuxieshoutaiwanqiyedazaoquanxindianxinlianwangxitong-hunyanshangsonghuaquanbeiju-taitannikehao-nvziyanjingwachushitou-yingxiongbense-bianxinghouguimichengnvyou-xuezuan-xinhuashepimeirenyu-shishangzuijuxuannianbanjuesaiqiangshilaixisiqiangzhengbashuizhuchenfu-guichuidengzuozhesuopei-kejibeidangyegoudasi-xinlingbushou-guodegangzhangziruyuan-yuanxiaowanhui-wuchihundan-kongbuzhibo-yueqiu-mengfeiyanglannuchiweishang-kejishuma-weizhongguoyuzouhong-yinshinannv-sadingdingjiachangzhengtuxiliekainianshengdianzhenfaqian-tianqiyubao-qianjunyifa-qingqiuhuchuanshuo-wucaiyoumenzhicheshikong-lilingpoyazhoujilu-wenxiangshinvren-shijiebeinvdansanmibanshitingmaoliyaheziweimianchengjiushuangguanwang-shuqixueshengzhuangbanchujing-molukuanghua-weizhongguoyuzouhong-hunyanshangsonghuaquanbeiju-aizairiluohuanghunshi-sunzhijierentianjinhaiguanguanzhangqianrentianjingangshigudiaochashibinggu-yingyinxianfeng-jiaowodiyiming-maibaheyudishixiangzhuang-wanmeishijie-chaotuo-chuqingshishi-xinhuashepimeirenyu-yingchaojifenbang-tianqi-haerdeyidongchengbao-budanshouweiwangzidansheng-meinvmotejiashitanke-zhangziyichanhoulianyujiashuzhanshenzitifeinverqiqiuxiantongqu-zhongguopinliangqizhaogonggudiweishijiedierbingfeilangdexuming-beijiejiudejiangge-haitunwan-fengzhigu-zhaoliyinglianqingbaoguang-chumendeshijie-zhongguoshichangpingxingjinkouqicheyuqichenglaizitianjin-juedoushi-beijiaerhupan-budapeisidafandian-youlinggongzhu-qizongzui-wobuxihuanchouxuejiayandanwoxihuanchifanqie-muqimiya-duanbeishan-wujiandao-shuqixueshengzhuangbanchujing-xingjichuanyue-ribenkouyazhongguoyuchuan-bianhuren-zuishuaizhengjianzhaozouhong-zhongquanbagongwuyu-zhifubao-zhongguoyanfashijiedier-jianadasheyingshibuzhuobeijixiongxiangshouluorishunjianyonglanqieyi-tainvxingmengtinglibingshi-hulianwangjiaoyuyujingzhunfupin-wodeshijie-jinxingchulianbaoguang-nuannuanneihanguang-gongrentanyinlibozaofeng-yingchao-chaoshijiagaimianzezhang-luhanweibozhanghaobeidao-nvziqipalihunliyou-danaotiangong-yonggandexin-qianxideniao-milandajiayuzhongguofeng-xijiajifenbang-dalasimaijiajulebu-zonghengsihai-shenzhenloushizhangfulingpaoquanguoyourenchengbaozhengdongloumanmanmai-ouguansaicheng-faaimeiduanxinbeiqiasi-yunnanlankongquebeixiasi-ribenfangxiangshichaguochanyinxingjishuyanzhengjihuaxingshiyan-kuangyejuedoushi-liutaohuanmeirongyaquankouzhongjianshaizipaisukuhaobengkui-tiankongzhicheng-ribenjuxingniangaodalishibisaixuanshoubaoniangaopinnaili-shuxuezhongjishushizuiqimiaode-alijiankangyijiaojianguanwangyangtianheqishangsu-ouguan-xijuzhiwang-hunduanlanqiao-zhaoliyinglianqingzuoshi-wangdazhihuoyingdi-zhangfukannenqihouzisha-woshishanmu-lijiangguchengminfangzhaohuo-zhongmeiheanquanduihua";
        $arr = explode("-", $str);
        $brr = explode("-", $answer);

        if (count($brr) != 666) {
            $this->hint = "格式不对,解析后不是666个拼音索引";
            return;
        }
        $cnt = 0;
        for ($i = 0; $i < 666; $i++) {
            if ($arr[$i] == $brr[$i]) $cnt++;
        }
        if ($cnt > 645) {
            $this->res = true;
        } else {
            $this->hint = "总共匹配的共有" . $cnt . "个,未达到题目限定的要求";
        }
        return;
    }

    private function t100($answer)
    {
        $answer = trim($answer);
        if ($answer == "38361914509")
            $this->res = true;
    }

    private function t101($answer)
    {
        $answer = trim($answer);
        if ($answer == "cutandpaste")
            $this->res = true;
    }

    private function t103($answer)
    {
        $str = "3445435434334424434443443334455554444545545544554545554553245544434432443454443345452444443433433322132233323342243333334343343544345544333434442311424421153444435543243225443532422343343324344541454124555535324421454444453535455444434543334443153323253334324434442133442333233442444322333444243443433433443234433334432242144444313315434553434333143344334444544343434113141355411412153452341545454323131121211344441424454432454544443434423343444344344324545445545545244443444511344435553452155154535141335342451455513333334133333122233233321335433244435444443344454444344444443444443522333222322322321333343544443334443343154444454544432215143543231545335334434431444443442333444343353112432324132353344334434422232434433444443444344444324333434333334433333434344343334341432333423443545345444334334433443323244451253353325342422233333445335443524424344433434334434323344444433555225453333154413342441334243335144455545445435254544455454443424434444132344543445553333155255533434432443343334443334444532554343453333344231344355233334443324445442342433444422533444532333434234224414553441213233144455524333332434353324555345434554544444344344554324233231311313342354344445414323335314452314533354433433444544544533422324535344254133333133433313553234324344413331312132414224334444113114124415135141414414423443344544343453444444434444423135414444242543213135545544424332434333243434253223324333333333323432234232324552332433343334243445333543224234434544443333422244254343534323444334235243423233333434444554543425543423322343334434344433143333333253335124353412133424445243424354343242243332533433344445533343422434353533443545445134443345143334421513342431134432254333431343534114544324423421455453354153325341523241423443545454545355534545554545544344433244423243324323323242233434443444341235554555553435555345215445455555435454544554445455335345454444454545553324212333444432334332342224224324423234433232322332232312223333223231322333443333344551144143444352451415145344343125344444441454452445454444344444144443335445454455324354444544532423344425524534244455555544234444434442333544422342434342243122411524141433313222351235423442323143122442311123233244213341214432344513445224354445155423445555545545543342434342244433333324424435144344434224535434444334243545434345354343433353343533443454341313344343122445433335333133434232343523132232333324323421234142434244243335434443334343334543444434543434444444133543134233423353244434343532552443442354444523442114435532412225424531555155541151551115115111511511115133333432433324422332313233352254352414443433353445344442423444333433443524423344344444423214244543344412311424532452141524211111431154443444244335434444443354343353434333443353345433434444444454332443432144343224234233333334443433323333442433334254231324325343344443424423333434431433342243424433233443324323242432142323323213333323432333233343434434323433343344333334134324311441235212321335341354144442231221333122222323442543433232345525433544334342354434342233434133331123133135322333121532332334424453233434354253214333554213434431133444432414331232224323232242222433223422233232322322223223222322434232222123233222242333222222223223223232423233225455554554144443343545552343224443444454424334425255144151451554254425525551541121533344344543334454433444444142434455354444443345545433453433444434444544335354415554454324444325334443444445443444444333434332334434334523544434334445344433445544552555345445345524445554443453554535555545533333344442443442334233434333333234434324334245331343334453443524322434334433342243232443432423333434254334334432434144244434434334332334244444432344454443424444322334233555412434243443451232513243424122422134224533313331225324344333233454435555533354453445454254444455444343444221333242321121214132332254412225443332134233353244332332434334432344453424354124544545553542434344443433433311343332343333434524444424223141331243253144413143434223443344235323432333343333543313533334333333533533222222112444212121312231311213432455342344545335545444534355535445554445545444452554445455553545445455454412444553431553541343433345434444435144434434534425434555434441454432444335343545425342134553341113424514541543334544324434353542435341444151544334353241423335552455531245155343555545333334243224353343543323443443443232434434344243554345433144544133345544443343442243354345455555544432454445445444442335434353455244254353553445543344442334243333434433544544353554344444455444442544334234555455455525554553544343544554454533543455545435453355524533545443554554434343444554553444554131453454434323235544433334143444444524524454435343444434444444255435415553442544334545442244323433243334542244333434333443344333323343343322234452544233433343334343433334134543344434343325424233345444444323345334343433332433443323344431433233345343242421342432344132412442333224221531233333333213333332533334233231143322421235435445453344445434534252225322532543332323213433433243441443231123342343433454355453134343544434522423453243354354232435454441434342134335422212342453335514444542343234434435411111325115321131314433542224514524535244443333221435342442334342423433334334545454424543454455353432245141442333342335113453232334134523254543334552444253443454533343525153323435244244454131454414214454444444424433434344344252244334443533234344354542323343343334443434434444334534544332343144343334144444444433444434344543245443534555421333222533223344331255453212311331441543325244355545553424545545454453245554554445523333543354433445444444413534453313531433445355344443343433345444344344444334344343443444443433444344453443345535542353433454155533444553544344154553545453524334442454544443345434423432124444143353444343333323344545423244334443341335324433333233333134433432533343443454242443344134443223333233333234333333334434233411222133243441242433323213323132344434343334333435444444535544332534422433334442344531213334344234122321521223241324442533334232442313433133333144245241545244254544322344343334444354241423313354422433134114244345431134343133524143133243432344544433553445434514334554324155445155445344451154343422445325445455415343434325543232353444444443435333443333543454544444333453354554342112211123225334311111212143322413333132343323343433443544444445554435445454244335443435445342454334544344453344544553443444443454444523323334343333333323423334334323223434223322333444242334333434334434243333324134231413345414443341534423544432233313442444453442234242333123324453245344544553444343231324535244433333443453445343335444455453122355243423244513252333133443412113242423243422343312341344214133343333323345432243344443444233434441323233122354122513535422115541152243232155125325323443442454243444344445554544332555141424522433333334434353342424133224314444223313551455442312131131111143453233133532333341322211432323323343224421243332324134444534434445535245534544423313323333332332333323333232342233344333223323233433333333432334443323344455534354334243354344444432552344444343313113133133313331143333113143542345551351445355553153255444141554434543323443333334323143331132333332232312123233232142223444432323344332322223332134311211111111414113111111134334444333333334233134344334342444344344433245444325555444533444134544544144342353254324434545452533442452252443234434333333112254554215534324334552232321424541442342444223432233341443344243323342435535554334334312333342432325342453253335454545433253334343343524334223414133224342344335235333432435133442323442355454434444345555454334443555453444554455445453544445555434444444444531114444434345344344533222423344423434434244325312555445543545331255354331233431251223425545233344333224243322421314323343433143454524424332343423443334554533324444434321444253443421143411323223112242555553554555554545455535555244145545244244414434212343441534244314444232234344414434444454443524344155555435544444434244433433223113322244455444344413434434442424454541344355545555544545534535455555414244143151222321313342222111434133443214433354154313135154134542352324431412442414355244434244444434443333221424243332523453444231332335155343555224341355114332445521543411312411422424443444444323244334232423324532423344442424423312442312322121222241114344333455354444424433343543341444134544344415344344252344545443453334444414232534543453444543534343313253234452133533342344445315435523432232322243244132231332232543231313433244334552552344133533353355445434434553333454543544534334434344233443445345454134453444445543555543554434443244244422243434433235433433253234342334325534444344425155554445343343432323154435112432324124321334134222333313515134554545334445344333434544514355413255531553445545334545334233422414434345555343424255434311443151434144343434541433343442234123234534312355334334543434244435333453353221333222553354333444323252233232455533554553343434535453444455523455224243523314431534343355424335343425343344434333353545355441113113321311121133114311111242431233434135533342434334454534535443434534443344535344443444454553445435453424444454443334332533544354441222555443444344432243343142323332323342453443543312532243441555344455555535443445555444454554445345535443454434444245512443444543142444431135351545422241553341544323444334434434435433444323324433534335335244244343334424153324331353232323243344332423433423443334444534454444443444444445443544141131322231551313253432521313115111144141341255434445334544335545443344312133334421314323333133343343234333444155112414424114112223353543213313314244345344414443344443425433444344423443444334343444233354543525253434345154251553123443152542443351114344245434453344342454434433444434534345522244224543115414325143414111213222125123424223434233114442434423435534344544212123234422423444534433334352344544455532254542443254544421524334323323433423344343433243544524434542445433342554341244432343555254333344344344342441252444552454344442423243244444434111431451422445441441134243443133231341441313422525444344122542444553453522544434334424334444433434444344244444434443433444242212434555243452241434324334444323533332345433224333423223445";
        $answer = trim($answer);
        if (strlen($answer) != 10000) {
            $this->hint = "答案的长度不对,需要提交1个长度为10000的字符串";
            return;
        }
        $sum = 0;
        for ($i = 0; $i < 10000; $i++) {
            $sum += abs(intval($answer[$i]) - intval($str[$i]));
        }
        $this->score = $sum;
        if ($sum > 10000) {
            $this->hint = "你和正确答案的差距非常巨大";
            return;
        }
        for ($i = 10000; $i >= 6000; $i -= 500) {
            if ($sum > $i) {
                $this->hint = "你和正确答案的差值在" . $i . "-" . ($i + 500) . "之间";
                return;
            }
        }
        $this->hint = "恭喜你通过此题，你的差值为" . $sum;
        $this->res = true;
        return;

    }

    private function t105($answer)
    {
        $ans = trim($answer);
        if ($ans == "bpgnd-vbscm-chejl-kwazn-daygi-kwazn-dmajv-kpxwm-dvoyd-kwazn-eehzw-vbscm-ensym-vbscm-enudn-uveul-eybii-gaagz-gaagz-vbscm-jnhno-zocos-jrqjd-kwazn-kpxwm-uveul-krcep-ensym-kwazn-uveul-mzrjt-vbscm-oaqoa-gaagz-opzmc-opzmc-rlrlm-wqhcn-sxyco-oaqoa-tbeyw-kwazn-uatqm-sxyco-uveul-vbscm-uwtms-chejl-vbscm-uveul-vlwtn-uveul-vssxi-uatqm-wcqtl-zocos-wqhcn-mzrjt-zocos-oaqoa") {
            $this->res = true;
        }
    }

    private function t106($answer)
    {

        $answer = trim($answer);
        if ($answer == "shortofasixpack")
            $this->res = true;
    }

    private function t107($answer)
    {

        $answer = trim($answer);
        if ($answer == "35249")
            $this->res = true;

    }

    private function t108($answer)
    {

        $answer = trim($answer);
        $str = "22080688,18074514,25747941,68193668,49324427,82589975,18259172,60487194,37111558,29912833,41856446,31249129,39037672,51464808,36727541,42335758,74992065,75739255,50081692,55377523,43992689,31360293,67110303,36244604,42515517,37785669,29481362,5461265,6738722,7731560,20915408";
        $arr = explode(",", $answer);
        if (count($arr) != 31) {
            $this->hint = "格式错误";
            return;
        }
        $brr = explode(",", $str);
        $sum = 0;
        for ($i = 0; $i < 31; $i++) {
            $a = intval($arr[$i]);
            $b = intval($brr[$i]);
            $sum += abs($a - $b);
        }
        if ($sum < 500000)
            $this->res = true;

    }

    private function t109($answer)
    {

        $answer = trim($answer);
        if ($answer == "aaae21a68b2ea6ecb8913d245703bd94")
            $this->res = true;

    }

    private function t110($answer)
    {

        $answer = trim($answer);
        if ($answer == "783d7c57656a8aa45bfdd6ebc88bea80")
            $this->res = true;

    }

    private function t132($answer)
    {
		$url="http://121.201.8.217:10086/verify_factorial?lambda=".urlencode($answer);
		$data=file_get_contents($url);
		if($data=="accepted")$this->res=true;
    }
    private function t134($answer)
    {
		$arr=explode("\n",$answer);
		$this->hint=count($arr);
		if(count($arr)!=500)
		{
			$this->hint="提交的信息应该是500行的";
			return;
		}
		$crr=array();
		foreach($arr as $a)
		{
			$brr=explode(",",$a);
			$crr[$brr[0]]=1;
			if(count($brr)!=2)
			{
				$this->hint="该行格式错误:".$a;
				return;
			}
			$str=md5("qlcoder_".$brr[0]."_20160526");
			$str=substr($str,0,8);
			if($str!=$brr[1])
			{
				$this->hint="该行的昵称不对:".$a;
				return;
			}
		}
		if(count($crr)!=count($arr))
		{
			$this->hint="提交的信息有重复的邮箱";
			return;
		}
		$this->res=true;
    }



	private function t133($answer)
    {
		$url="http://121.201.8.217:10086/verify_fibonacci?lambda=".urlencode($answer);
		$data=file_get_contents($url);
		$cycle=intval($data);
		$this->hint=$data;
		if($cycle>10)
		{
			$this->res=true;
			$this->score=$cycle;
			$this->hint="你的counter数为".$cycle;
		}
		else $this->hint=$data;
    }

    private function t112($answer)
    {

        $answer = trim($answer);
        if ($answer == "Steve Jobs")
            $this->res = true;

    }

    private function t116($answer)
    {
        $answer = trim($answer);
        if ($answer == "D19B42762CBD2EFAD26ECF03DF0942F4C2516ADBF1AB90CAF6A4AE7493AE3C4689138795099471385B550FECE62B52C023955B7AA569AE1079A1DD3815AA523F81BBE15CE2EAB7BE457ACAF1E8788E125C2EFC7D431CE81ACE23080A45E0A319F52C53FAFB46C85C2835D8F5493556D8A79D698AF95FD269B88CED51484DC494FE54A941A457B88BF33370FFCB5A766A46CB8AA8B867C35C2DA01995EC0EEF1083C907279B776785E263C7BDAC6D42631DABB51A4A524E36CC58D8A6062267724689AFAAA1EB05512A3B2FE26821B0FD3BD59300ADCC927742E2333BDF9DA3B6ED2DDAABBA71B8C040B88CAA69F9DAAAFE981D1F565635F26FA8DCB0D12DB8F2A1F0242EE34058E963C70A9D23B973BEDEDCD0AE0182E6ED")
            $this->res = true;
    }

    public function t118($answer)
    {
        $answer = trim($answer);
        $str = "14672688523343131182667874742627721873378723145234127444217456113615673255522816488531687613871223612881414448371588676345677217728476514868141138132174888616363736855576648723245858441442528334124351217324674287827813312585684632582155457847335231587413815458822714284886543835744522248228284743386266266554185778783627163211753271187363162257112226517247571274377411167613144724667247122781735173477287476324827158637775443442145177662357613164264118356557622164345625385227126275656745111233247715352186346717712657721667627113184238437225522286777834381418235823856536877236131884438421161218432771168561314542248263116153758166878174244281556614345161427164251578148148685623174873384111566747426813435865582358863456411575256678338161128773632784678312217613326714188555524618225285461388727661652464248641122488342374458644512144551332431331356562631672544348477588624231758625185525821286871165751568118738865734442263124655483238612453173571868768116141254763124648834651786738123354315552348333141183642126225253821486765154662164556433884844712544127586546784164784562346885736335285557863863241674373828275663847858577788652624255813411347522382253742271345247527256717887511481735234877581183661287844677268186872731877483382614134576121848874764858626617534654235145764871838275563525835546116478778732785487335126523717741843432757561415463177434843871384183266547626174626182334724184338268435782531376552452141645432751284185258227487575651613475853111441315178454583122833137138541674137115745285516882524415877323284584314314211635528636366244756173146558776241854554886228745182535182578187876352755564354567367413154648377635647324876362122484533583661746518618568384263434773354344462871325754631536413432311458586141835863688217858618368635881854246561326474758776578832516122886221585712761173513675232857246884666375513761324483353613368418274647331415643225646571367836623335755553586733223634535212157234825441738413452117472418528586134342652378553325387721174416367641718575746225541532126183784742611534685257438418633218422486524377663286566854813766233721537882462324127685568785515164844376483158671816575618113465784234242548376342446455686235118748238244788384311327156211284721447243248362454534744734475376478321623863175638326778616281367766316138447632857135852353826582253611655616884747441364681241816135334257386863543135456565145837618655435447353117225537264676156224727526884325867616571514651228115524654776227231617333532446288278428612865557253126454835226743228477688146746313346227136628367317283645824243721674474783155764373266554642848664623157642421827131285488288471761225574478471843682224546278613267177114557232576765113437313437561552534755564117253237131822143613585861786375618566224354772131537235686178477233553468556827377413371552831514466782815351835581888831265563138861834721374684135462272886181216512331671726617744533517258434464456561887816344267131244342577868632284783421476741567417544583686622568627432868838865627673411243617553316625666167467681132542641211178162553647761572474716343423758184446663325837176512166471255537258635885463536618515132276577243432424818882115524787615846158752884547512656422276765311884482428766337622863285884631627132624252226254367613663681184487534211226331132135184274153375782746664515347586243276136477758874375125345621575835381461381478512525352325112642744162573175417484645743525432553677832865411551373261678767811621548714787817157872682182365476723647216143871317137556756267145385831717226237841547251417826445116173145847145372478258871587343188452244745567724713858253425218281145155684722771876561636341411158668775877776637215465151524316137737625633618341566585381666454825522584643711457853865852347843761374628884443854721236112283336131733774664566865675555482551637847353534722211568673831553612753157814146343856333336238637774332832322147787853465734681127411825575486381121181387453222165868837661528581543716514211747547887387617723274263752235835875536745225427213878841162235364654576455632164732265412423831357418654168122328247747581477374438233173887152872672428772352521663728462637363721262882224554376125488351287475872241753848148518288842487688122262645235648586336387777178561238647312637182524676383643854173337413648734824131767445218637824866155258253583122817273582431625222277328423824532271728846678814878362288216421277231222456254176564713884682268854555725465231675222885817257723737228262658413772372838366661277564481475416778351255682663437181887554177588154144633774481824153318145184633414228612656352465484844761841221328648388344253845515344611213482483776341477157582737785643855587155526337262612357472467886874724488176342117354641377466677371627124262548317527653552631712183744114711851673172378735475776528541772425573468744782113524263484184624527823337387113665484366718332331647866586143175336718671862352787218318544476637866673311761156483777477571834227144246888426671757533856388786246711642617161226641214773111813182555572154281533388173166872333463232318683422488815112635446627727775577858381663887633166527471624662552373622462574464286717351144454883152281242677371311615366165641248222568175384618144168731837385587326644753171435234266458378418882373875561214433432427428167736362527273541883262575725388223676448213622842711485461885813671275547785486316443141841423366866458437241478477714786377543128736882781158312735515113784715226542224317716412757545366241574245278784483473611416247647513188443831316668514452674765825885286275838884533868784584554532175362564654378384647436548718572253831336456254821634417671213276245884246885873784216865865614472857617724782251576186131838553144435677178128823415682716347133341468128663665116576738854234448587361524863121285766283336767664647842681232118274466586862243577353328528177713148421266847586674276538234688845552237861628136587588571568556688466818541187467633362215246714866734612347152314666282517472685453113727246731866268327355817445247266736188873827855874432621185835553627232533674246483565153682855534117452187631583523184123586755113164877281283141464716558445462288545164734238257255745161122724633315217217178471677131645654667365382258542677356381326738835878745322722715174586833344438563388132165547761564261757561628831442751136754328717678466145761844235863852237543661211155743626613716832644546477551311886878572315168188173281154367633634653114838161767352324775253577362326533363543322563331452858271465715745212632173518773748118733813335727477267554558556753157748727246851355483371645588232167787376331834858858576454727552375345271851663233588772356478551432433263476536135333643633618175158213183324158361143837256616734244255438452831142544751562453753581188412426342775381831865613122486758662877174488317137467134762768474357227356522847238722453883865887587525663253335664236226826773757126326651716636765236618674567648542613313256225213764846181182266587665228148366544313852534112585515411578837484656527462543133367135886172153438547526865341838843525248685277646447376436833641242212482464845254278148371838428343848318621647228647531384166821663511348422521681118223372622128678637583513857641326688721718523623648452826243137722475182748122218757435474373336458424553626678563126645158753841188256661564858351176237482515425573847313417228811238278852367535117771531471564716326568522621626676185442253121536316768727166575842375826267313835427583613538584587718816841818628242153537785716186874774166582278157243636671761343861478343146681667261761857137861712468655436384355242118373667183324786768344737287372217773216443817725347631322385137885851251456852766782534237574452354821433412134512683848845672256654566273646835282621684766524145423366771124238527458674315823618135777262875485186212845652878285175571244252164527133866213743151225622854717766414534335726485472246672473561458152432724213126317554538824521524114434655842148473441871333748654682485757562114615754547643526754122223252357252841236138112878";

        if (strlen($answer) != 8000) {
            $this->hint = "字符串长度不对";
			return;
        }
        $cnt = 0;
        for ($i = 0; $i < 8000; $i++) {
            if ($answer[$i] != $str[$i]) $cnt++;
        }
        if ($cnt <= 800) {
            $this->res = true;
			$this->score=$cnt;
			$this->hint="你的正确率为".intval((8000-$cnt)*100/8000)."%";
		} 

		else if ($cnt <= 1600) {
            $this->hint = "你的正确率在80%-90%之间";
		}
		else if ($cnt <= 2400) {
            $this->hint = "你的正确率在70%-80%之间";
		}
	   	else
            $this->hint = "你的正确率小于70%";
    }

    public function t144($answer) {
		$answer = trim($answer);
		//var_dump($answer);
		//return;
		if (strlen($answer) <= 0) {
			$this->hint = '答案为空';
			return;
		}
		//$command = 'python /root/selenium/check_connect_three.py '.'\''.$answer.'\' 2>&1';
		$command = 'python /root/selenium/check_connect_three.py '.'\''.$answer.'\'';
		$output = shell_exec($command);
		//var_dump($output);
        if (strpos($output, 'pass') !== false) {
            $this->res = true;
			//$this->hint = $output;
		} else {
			$this->hint = $output;
		}
    }

    function milliseconds() {
        $mt = explode(' ', microtime());
        return ($mt[1]) . round($mt[0] * 1000);
    }

    public function t145($answer) {
        $answer = trim($answer);
        if (strlen($answer) <= 0) {
            $this->hint = '代码为空';
            return;
		}
		if (strlen($answer) > 1000) {
			$this->hint = '代码太长了，你真的会Sass？';
			return;
		}
		$timestamp = $this->milliseconds();
		$filename = '/opt/jail/home/qlcoder/onlinejudge/task_144/submission_' . $timestamp;	
		$filename2 = '/root/work/public/submission/submission_' . $timestamp;	
		file_put_contents($filename . '.sass', $answer);
		file_put_contents($filename2 . '.sass', $answer);
        $sass_command = 'timeout 10 /usr/local/bin/sass ' . $filename . '.sass' . ' ' . $filename . '.css 2>&1';
		$output = shell_exec($sass_command);
		if (strlen($output) > 0) {
			$output = str_replace('/opt/jail/home/qlcoder/onlinejudge/task_144', '/wonderland', $output);
			$this->hint = "编译错误: " . $output;
			return;
		}	
        $sass_command = 'sass ' . $filename2 . '.sass' . ' ' . $filename2 . '.css';
		$output = shell_exec($sass_command);
		
		$command = 'python /root/selenium/check_rect.py '.'\''.$timestamp.'\'';
        $output = shell_exec($command);
        if (strpos($output, 'pass') !== false) {
            $this->res = true;
        } else {
            $this->hint = $output;
        }
    }

    public function t147($answer) {
        $answer = trim($answer);
        if ($answer == "LinuxContainer")
            $this->res = true;
    }

    public function t148($answer, $uid) {
        $answer = trim($answer);
        $url = 'http://121.201.15.50:5000/test';
        $data = array('tag' => $uid, 'dockerfile' => $answer);
        $options = array(
            'http' => array(
                'header'  => "Content-type: application/x-www-form-urlencoded",
                'method'  => 'POST',
                'content' => http_build_query($data)
            )
        );
        $context  = stream_context_create($options);
        $result = file_get_contents($url, false, $context);
        if ($result === FALSE) {
            $this->hint = '网络错误,联系管理员';
        } else {
            $result = trim($result);
            $result = str_replace("\n", '<br>', $result);
            if ($result == "docker") {
                $this->res = true;
            } else {
                $this->hint = "你返回的结果为:<br>" . $result;
            }
        }

    }
}

?>
